diff --git a/libs/libc/time/lib_localtime.c b/libs/libc/time/lib_localtime.c index 76f4fc8b86d..e2374c84ec4 100644 --- a/libs/libc/time/lib_localtime.c +++ b/libs/libc/time/lib_localtime.c @@ -1806,6 +1806,7 @@ static FAR struct tm *localsub(FAR const time_t *timep, result = timesub(&t, ttisp->tt_gmtoff, sp, tmp); tmp->tm_isdst = ttisp->tt_isdst; tzname[tmp->tm_isdst] = &sp->chars[ttisp->tt_abbrind]; + tmp->tm_zone = tzname[tmp->tm_isdst]; return result; } @@ -1829,6 +1830,7 @@ static FAR struct tm *gmtsub(FAR const time_t *timep, tz_semgive(&g_gmt_sem); + tmp->tm_zone = GMT; return timesub(timep, offset, g_gmt_ptr, tmp); } @@ -2003,7 +2005,6 @@ static FAR struct tm *timesub(FAR const time_t *timep, tmp->tm_mday = (int)(idays + 1); tmp->tm_isdst = 0; tmp->tm_gmtoff = offset; - tmp->tm_zone = tzname[0]; return tmp; }