Don't use strftime

This commit is contained in:
Alex Hultman
2022-11-26 05:56:26 +01:00
parent 8a57fd06bd
commit c8229b5781
+15 -1
View File
@@ -68,7 +68,21 @@ public:
#else
gmtime_r(&now, &tstruct);
#endif
strftime(date, 32, "%a, %d %b %Y %X GMT", &tstruct);
static const char wday_name[][4] = {
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
};
static const char mon_name[][4] = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
sprintf(date, "%.3s, %.2d %.3s %d %.2d:%.2d:%.2d GMT",
wday_name[tstruct.tm_wday],
tstruct.tm_mday,
mon_name[tstruct.tm_mon],
1900 + tstruct.tm_year,
tstruct.tm_hour,
tstruct.tm_min,
tstruct.tm_sec);
}
char date[32];