#include <locale.h>
#include <time.h>
#include <limits.h>
+#include "locale_impl.h"
#include "libc.h"
#include "time_impl.h"
fmt = "%H:%M";
goto recu_strftime;
case 's':
- val = __tm_to_secs(tm) + tm->__tm_gmtoff;
+ val = __tm_to_secs(tm) - tm->__tm_gmtoff;
width = 1;
goto number;
case 'S':
return "";
}
*l = snprintf(*s, sizeof *s, "%+.2d%.2d",
- (-tm->__tm_gmtoff)/3600,
+ (tm->__tm_gmtoff)/3600,
abs(tm->__tm_gmtoff%3600)/60);
return *s;
case 'Z':
size_t strftime(char *restrict s, size_t n, const char *restrict f, const struct tm *restrict tm)
{
- return __strftime_l(s, n, f, tm, 0);
+ return __strftime_l(s, n, f, tm, CURRENT_LOCALE);
}
weak_alias(__strftime_l, strftime_l);