added check for tm->__tm_gmtoff and tm->__tm_zone.

changed sys::strftime() to set tm_zone to GMT if sys::STRFTIME_UTC is set
This commit is contained in:
2019-07-01 15:02:43 +00:00
parent 4257ef5296
commit 43cfbd6bdf
5 changed files with 63 additions and 0 deletions

View File

@ -746,7 +746,17 @@ static int fnc_strftime (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi)
tm.tm_isdst = bt.isdst;
#if defined(HAVE_STRUCT_TM_TM_GMTOFF)
tm.tm_gmtoff = bt.gmtoff;
#elif defined(HAVE_STRUCT_TM___TM_GMTOFF)
tm.__tm_gmtoff = bt.gmtoff;
#endif
if (flags & STRFTIME_UTC)
{
#if defined(HAVE_STRUCT_TM_TM_ZONE)
tm.tm_zone = "GMT";
#elif defined(HAVE_STRUCT_TM___TM_ZONE)
tm.__tm_zone = "GMT";
#endif
}
sl = strftime(tmpbuf, QSE_COUNTOF(tmpbuf), fmt, &tm);
if (sl <= 0 || sl >= QSE_COUNTOF(tmpbuf))