time_t t = record_hdr->ust_time;
int rc = 0;
- /*
- * Fill generic rectime structure in local time.
- * Done so that we have some default values.
- */
- ltm = localtime_r(&t, rectime);
+
if (!PRINT_LOCAL_TIME(l_flags) && !PRINT_TRUE_TIME(l_flags)) {
/*
* (the user doesn't want local time nor time of file's creator).
*/
ltm = gmtime_r(&t, rectime);
+ } else {
+ /*
+ * Fill generic rectime structure in local time.
+ * Done so that we have some default values.
+ */
+ ltm = localtime_r(&t, rectime);
+ rectime->tm_gmtoff = TRUE;
}
if (!ltm) {