@@ -964,12 +964,15 @@ PrintTOCSummary(Archive *AHX, RestoreOptions *ropt)
964
964
teSection curSection ;
965
965
OutputContext sav ;
966
966
const char * fmtName ;
967
+ struct tm * tm = localtime (& AH -> createDate );
968
+ char stamp_str [64 ];
967
969
968
970
sav = SaveOutput (AH );
969
971
if (ropt -> filename )
970
972
SetOutput (AH , ropt -> filename , 0 /* no compression */ );
971
973
972
- ahprintf (AH , ";\n; Archive created at %s" , ctime (& AH -> createDate ));
974
+ strftime (stamp_str , sizeof (stamp_str ), "%Y-%m-%d %H:%M:%S %z" , tm );
975
+ ahprintf (AH , ";\n; Archive created at %s\n" , stamp_str );
973
976
ahprintf (AH , "; dbname: %s\n; TOC Entries: %d\n; Compression: %d\n" ,
974
977
AH -> archdbname , AH -> tocCount , AH -> compression );
975
978
@@ -3455,21 +3458,9 @@ checkSeek(FILE *fp)
3455
3458
static void
3456
3459
dumpTimestamp (ArchiveHandle * AH , const char * msg , time_t tim )
3457
3460
{
3458
- char buf [256 ];
3461
+ char buf [64 ];
3459
3462
3460
- /*
3461
- * We don't print the timezone on Win32, because the names are long and
3462
- * localized, which means they may contain characters in various random
3463
- * encodings; this has been seen to cause encoding errors when reading the
3464
- * dump script.
3465
- */
3466
- if (strftime (buf , sizeof (buf ),
3467
- #ifndef WIN32
3468
- "%Y-%m-%d %H:%M:%S %Z" ,
3469
- #else
3470
- "%Y-%m-%d %H:%M:%S" ,
3471
- #endif
3472
- localtime (& tim )) != 0 )
3463
+ if (strftime (buf , sizeof (buf ), "%Y-%m-%d %H:%M:%S %z" , localtime (& tim )) != 0 )
3473
3464
ahprintf (AH , "-- %s %s\n\n" , msg , buf );
3474
3465
}
3475
3466
0 commit comments