date: preserve isdst value if date is in time_t (unix time) format

Signed-off-by: Alexey Soloviev <EXT-Alexey.Soloviev@nokia.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Alexey Soloviev
2010-12-31 05:21:51 +01:00
committed by Denys Vlasenko
parent a9e25ffa67
commit a5d3d3436b
2 changed files with 16 additions and 1 deletions

View File

@ -282,7 +282,9 @@ int date_main(int argc UNUSED_PARAM, char **argv)
}
/* Correct any day of week and day of year etc. fields */
tm_time.tm_isdst = -1; /* Be sure to recheck dst */
/* Be sure to recheck dst (but not if date is time_t format) */
if (date_str[0] != '@')
tm_time.tm_isdst = -1;
ts.tv_sec = validate_tm_time(date_str, &tm_time);
maybe_set_utc(opt);