@@ -964,12 +964,15 @@ PrintTOCSummary(Archive *AHX, RestoreOptions *ropt)
964964 teSection curSection ;
965965 OutputContext sav ;
966966 const char * fmtName ;
967+ struct tm * tm = localtime (& AH -> createDate );
968+ char stamp_str [64 ];
967969
968970 sav = SaveOutput (AH );
969971 if (ropt -> filename )
970972 SetOutput (AH , ropt -> filename , 0 /* no compression */ );
971973
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 );
973976 ahprintf (AH , "; dbname: %s\n; TOC Entries: %d\n; Compression: %d\n" ,
974977 AH -> archdbname , AH -> tocCount , AH -> compression );
975978
@@ -3455,21 +3458,9 @@ checkSeek(FILE *fp)
34553458static void
34563459dumpTimestamp (ArchiveHandle * AH , const char * msg , time_t tim )
34573460{
3458- char buf [256 ];
3461+ char buf [64 ];
34593462
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 )
34733464 ahprintf (AH , "-- %s %s\n\n" , msg , buf );
34743465}
34753466
0 commit comments