aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--win32/mingw.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/win32/mingw.c b/win32/mingw.c
index 4c449514a..f9967f1c4 100644
--- a/win32/mingw.c
+++ b/win32/mingw.c
@@ -972,9 +972,11 @@ size_t mingw_strftime(char *buf, size_t max, const char *format, const struct tm
972 int m; 972 int m;
973 973
974 /* 974 /*
975 * Emulate the '%e' and '%s' formats that Windows' strftime lacks. 975 * Emulate the some formats that Windows' strftime lacks.
976 * Happily, the string that replaces '%e' is two characters long. 976 * - '%e' day of the month with space padding
977 * '%s' is a bit more complicated. 977 * - '%s' number of seconds since the Unix epoch
978 * - '%z' timezone offset
979 * Also, permit the '-' modifier to omit padding. Windows uses '#'.
978 */ 980 */
979 fmt = xstrdup(format); 981 fmt = xstrdup(format);
980 for ( t=fmt; *t; ++t ) { 982 for ( t=fmt; *t; ++t ) {
@@ -1017,7 +1019,7 @@ size_t mingw_strftime(char *buf, size_t max, const char *format, const struct tm
1017 1019
1018 hr = offset / 3600; 1020 hr = offset / 3600;
1019 min = (offset % 3600) / 60; 1021 min = (offset % 3600) / 60;
1020 sprintf(buffer+1, "%02d%02d", hr, min); 1022 sprintf(buffer+1, "%04d", hr*100 + min);
1021 } 1023 }
1022 newfmt = xasprintf("%s%s%s", fmt, buffer, t+2); 1024 newfmt = xasprintf("%s%s%s", fmt, buffer, t+2);
1023 free(fmt); 1025 free(fmt);