[En-Nut-Discussion] Is this a bug or a feature in mktime?

Dave ethernut at wormfood.org
Thu Jun 9 12:51:03 CEST 2005


Hi everyone,
   I'm not sure if this is a bug or a feature. I've been playing around
with the mktime function, and I noticed that if set the date to a time
of the year, so that it is opposite of how tm_isdst is currently set,
then my time will be ahead or behind by one hour.

   For example, if the tm_isdst flag is clear, and I enter todays date
with a time of 6:00, it will set the tm_isdst flag, and put my time at
7:00. If the tm_isdst flag is set, and I set the date to December and
the time to 6:00, then it will clear the tm_isdst flag, and set the time
to 5:00.

   Is it supposed to work this way? In my eyes it is a bug, but that may
be the way it is supposed to work. I'm sure I can 'fix' it, but I don't
want to break something else if it is supposed to work this way. Can
someone let me know before I try to fix something that may not be
broken?

-Dave




More information about the En-Nut-Discussion mailing list