Slashdot Mirror


Daylight Savings and UNIX?

Anonymous asks: "My company recently asked me to write them a report on how UNIX properly handles the switch to Daylight Savings Time, and back again. When our systems administrators received the report, I was somewhat surprised. Many of them weren't aware that 'cron' would run the affected jobs twice in the fall, and not at all in the spring. Apparently, the man pages on some operating systems, like Solaris, aren't forthcoming with details. Others groups, like database administrators, are completely unaware of the differences between epoch time and wall clock time. Are even technical users ignorant on how UNIX handles time, time zones, and time conversion?"

94 comments

  1. DST? by lburdet · · Score: 2, Insightful

    considering i never wind my (analog) watch back or forward, why should i expect my computer to do any better?

  2. Wrong by gus+goose · · Score: 5, Insightful
    This is taken from the HP Cron man page.
    Spring and Autumn Time Transitions
    On the days of daylight savings (summer) time transition (in time zones and countries where daylight savings time applies), cron schedules commands differently from normal. In the following description, an ambiguous time refers to an hour and minute that occurs twice in the same day because of a daylight savings time transition (usually on a day during the Autumn season). A nonexistent time refers to an hour and minute that does not occur because of a daylight savings time transition (usually on a day during the Spring season). DST-shift refers to the offset that is applied to standard time to result in daylight savings time. This is normally one hour, but can be any combination of hours and minutes up to 23 hours and 59 minutes (see tztab(4)). When a command is specified to run at an ambiguous time, the command is executed only once at the first occurrence of the ambiguous time. When a command is specified to run at a nonexistent time, the command is executed after the specified time by an amount of time equal to the DST-shift. When such an adjustment would conflict with another time specified to run the command, the command is run only once rather than running the command twice at the same time. Commands that are scheduled to run during all hours (there is a * is in the hour field of the crontab entry) are scheduled without any adjustment.
    This is taken from the Linux cron manpage though:
    Note that this means that non-existant times, such as "missing hours" during daylight savings conversion, will never match, causing jobs scheduled during the "missing times" not to be run. Similarly, times that occur more than once (again, during daylight savings conversion) will cause matching jobs to be run twice.
    So, if you want things to work, use HP-Unix.

    gus

    P.S. Get to it, linux guys ... maybe I will have a look.

    --
    .. if only.
    1. Re:Wrong by JimR · · Score: 5, Informative

      Hmmm... this is what man cron gives on my Debian Linux box...

      Special considerations exist when the clock is changed by less than 3
      hours, for example at the beginning and end of daylight savings time.
      If the time has moved forwards, those jobs which would have run in the
      time that was skipped will be run soon after the change. Conversely,
      if the time has moved backwards by less than 3 hours, those jobs that
      fall into the repeated time will not be re-run.

      Only jobs that run at a particular time (not specified as @hourly, nor
      with '*' in the hour or minute specifier) are affected. Jobs which are
      specified with wildcards are run based on the new time immediately.

      Clock changes of more than 3 hours are considered to be corrections to
      the clock, and the new time is used immediately.
      --
      #exclude <ms/windows.h>
    2. Re:Wrong by Col.+Klink+(retired) · · Score: 4, Funny
      From my Debian Woody cron man page:
      Special considerations exist when the clock is changed by less than 3 hours, for example at the beginning and end of daylight savings time. If the time has moved forwards, those jobs which would have run in the time that was skipped will be run soon after the change. Conversely, if the time has moved backwards by less than 3 hours, those jobs that fall into the repeated time will not be re-run.
      --

      -- Don't Tase me, bro!

    3. Re:Wrong by mvdwege · · Score: 4, Interesting

      I can corroborate the previous statements.

      Although I am on Debian like the first two posters to reply, I did some more checking, and Debian installs vixie cron. AFAIK this is what most Linux distros install by default, including Red Hat, which I runned before this.

      Would you mind telling us what distro you had to dig up to find this gem? They deserve to be rightly flamed (and by extension if you can't give a satisfactory answer, you deserve to be flamed).

      Mart
      --
      "I know I will be modded down for this": where's the option '-1, Asking for it'?
    4. Re:Wrong by lithiumcloud · · Score: 1

      Slackware uses "Dillon's cron", and I have no idea whether it has cron jobs for daylight saving - I haven't looked at the clock since we switched to the new time a few weeks ago. I doubt it. It's fairly minimalist.

      --
      This space intentionally left blank.
    5. Re:Wrong by gus+goose · · Score: 2

      SuSE 7.2 - uses Vixie Cron... but apparently from 1993, version 3.0.9 or something.

      "man 5 crontab" has the entry.

      gus

      --
      .. if only.
    6. Re:Wrong by mvdwege · · Score: 1

      Hmmph.

      Silly SuSE.

      Do you (or anyone else for that matter) know if this is fixed in later SuSE versions?

      Mart
      --
      "I know I will be modded down for this": where's the option '-1, Asking for it'?
    7. Re:Wrong by WhiteDragon · · Score: 1

      I thought debian uses anacron

      --
      Did you mount a military-grade, variable-focus MASER on an unlicensed artificial intelligence?
    8. Re:Wrong by Anonymous Coward · · Score: 0

      What, you don't know the difference between anacron and cron?

  3. =P abcd1233243459834982 by Saiai+Hakutyoutani · · Score: 0, Offtopic

    My experience is that UNIX displays the incorrect time in any case, if you forget to update it from the hardware clock at every reboot. I have hwclock -s in rc.local when I feel like it. This happens regardless of the settings in the kernel (the APM settings).

    1. Re:=P abcd1233243459834982 by Anonymous Coward · · Score: 1, Informative

      ...sounds like someone doesn't have their daylight savings time rules or timezone set correctly. Does "TZ" ring any bells?

    2. Re:=P abcd1233243459834982 by einstein · · Score: 3, Funny

      You reboot?

      *rimshot*
      --

    3. Re:=P abcd1233243459834982 by Anonymous Coward · · Score: 0

      Du David, den derre hai-vitsen vakke særlig bra.

    4. Re:=P abcd1233243459834982 by Saiai+Hakutyoutani · · Score: 0

      Sugoi da ne.

  4. Nope by Clue4All · · Score: 5, Insightful

    Are even technical users ignorant on how UNIX handles time, time zones, and time conversion?

    Nope, technical users know that UNIX systems should be run using GMT, which doesn't observe daylight savings time.

    --

    Is your browser retarded?
    1. Re:Nope by duffbeer703 · · Score: 0, Offtopic

      Slashbot Linux h4x0rs don't know what GMT is.

      --
      Conformity is the jailer of freedom and enemy of growth. -JFK
    2. Re:Nope by Covener · · Score: 5, Insightful

      Technical users know UNIX systems should keep their hardware clocks in UTC, but should obviously be aware of timezones and local time.

  5. Varies depending on which "cron" by shoppa · · Score: 5, Informative
    There are multiple cron-type systems out there.

    Many Linux distributions ship with a heavily (and I mean heavily) patched up version of Vixie-cron as the default cron package. This is what many people refer to in this thread when they say "Linux cron".

    There are other cron packages out there for Linux; for example, fcron. Section 2.2 of the fcron FAQ says:

    First, you must understand that fcron determines, for each job, its next time and date of execution. It then determines which of those jobs would be the next to run and then, sleeps until that job should be run. In other words, fcron doesn't wake up like Vixie cron each minute to check all job in case one should be run ... and it avoids some problems associated with clock adjusts.

    This means that if the new time value is set into the past, fcron won't run a particular job again. For instance, suppose the real time and system clock are 3:00, so the next job cannot be scheduled to run before 3:00, as it would have already been run and re-scheduled.

    First, suppose you set your system clock into the past, say to 2:00, Presuming that the last run was shortly before 3:00. then fcron will sleep until the next job should be executed. The execution time for a job is determined by identifying the last time that the job ran and computing the next scheduled time. This means that the next scheduled time must be on or after 3:01. Therefore, in this example, fcron will not run a job for at least one hour.

    Next, if you set the system time into the future, say to 4:00, fcron will run every job scheduled between the old and the new time value once, regardless of how many times it would have been scheduled. When fcron wakes up to run a job after the time value has changed, it runs all the jobs which should have run during the interval because they are scheduled to run in a past time.

    As special case is when "@xxx" style scheduling rules are involved, you must consider the "adjustment-interval". The "adjustment-interval" is the time difference between the original system time and the new system time. If the ... run at "adjust-interval" too early or too late depending of the nature of the adjust.

    To conclude, fcron behaves quite well for small clock adjusts. Each job which should have run does so once, but not exactly at the correct time as if the job were scheduled within the adjustment interval. But, if you have to make a big change in the time and date, you should probably reset all the scheduled "nextexe" by running "fcrontab -z" on all the fcrontabs.

    And to further complicate matters, most commercial Unix-type OS's are either completely independent of Vixie-cron or they genetically "diverged" from Vixie-cron so long ago that they bear only faint resemblance to the original.

    Maybe those technical people who you are questioning worked on a non-Linux system that doesn't suffer from the idiosyncrancies of Vixie-cron, or maybe they use fcron.

    1. Re:Varies depending on which "cron" by Anonymous Coward · · Score: 0

      You forgot about dcron, which is in fact what I run.

  6. If your going to ask about your report by cs668 · · Score: 1

    Why not let us read it? Maybe it would help out some other people.

    But you are right about databases. Most DBAs( that I have worked with ) are not away of the TZs effect on the database.

  7. I guess that's what you get.... by eclectric · · Score: 3, Funny

    for using daylight saving time. Come to Indiana, where people are more normal, and don't try to change time itself.

    1. Re:I guess that's what you get.... by RocketJeff · · Score: 3, Funny
      Come to Indiana, where people are more normal, and don't try to change time itself.
      I always heard that (most of) Indiana didn't change the clocks because they thought it would confuse the cows...
    2. Re:I guess that's what you get.... by rw2 · · Score: 3, Informative

      confuse the cows

      Smirk. My uncle works in state government in Indiana and I tease him about this from time to time. He's been around long enough to remember the debate on this one and he says that *one* of the reasons that they don't switch is because the drive-in-movie theaters had a strong lobby the last time this was seriously discussed.

      That always cracks me up. The entire state is out of step with their neighbors because of theater owners.

      They are considering changing to a more conventional (notice I didn't say 'normal', just conventional) system and he says "I don't think that lobby is as strong as it used to be".

    3. Re:I guess that's what you get.... by ichimunki · · Score: 2, Informative

      Um. BZZZT! Different parts of Indiana are in different time zones and some of those parts do observe DST. (reference). In fact, of all the states, Indiana is probably the worst in this respect. If you have trouble dealing with clocks, the place to be is Arizona.

      --
      I do not have a signature
    4. Re:I guess that's what you get.... by crath · · Score: 4, Insightful

      It's sad to hear that Indiana may bow to peer pressure from the rest of the world w.r.t. Daylight Savings Time (DST). There have been a number of very credible studies done over the past decade, and DST costs lives (and money) due to the manner in which it disrupts our body clock.

      The grand hypocracy of the whole DST gambit is the DST supporters' claim that the energy savings justify DST; i.e., let's annually sacrifice a few thousand people to save a bit of energy.

      If DST supporters truly want to put an open and honest argument on the table for their position, their cost-benefit analysis needs to account for the lost lives, lost quality of life due to personal injuries, lost productivity, lost monies, etc., in addition to tallying up the energy savings and extra time spent on the golf course.

      Why is it too much to expect that people turn their brains on, fire a few neurons, and produce cogent thought? DST is yet another example of, "It *feels* good so it must the right thing to do."

    5. Re:I guess that's what you get.... by battjt · · Score: 2

      Actually we subscribe to newtonian physics. Time is constant. This is a step forward from when the legislature declared PI to be 3.

      I personally think that everyone should switch to GMT. Why should everyone in the country wake up at 6 am local time anyway?

      Joe

      --
      Joe Batt Solid Design
    6. Re:I guess that's what you get.... by Anonymous Coward · · Score: 0

      We don't need it in Saskatchewan, either. The sun still comes up and goes down, so what's the big deal with Daylight Saving Time anyway?

    7. Re:I guess that's what you get.... by the+hopthrisC · · Score: 1

      Why should everyone in the country wake up at 6 am local time anyway?

      because it would be very confusing to have a day change 3 hours waking up? Or in the middle of lunch...

    8. Re:I guess that's what you get.... by Mignon · · Score: 2
      Come to Indiana, where people are more normal, and don't try to change time itself.

      Yeah, just fundamental mathematical constants.

    9. Re:I guess that's what you get.... by rw2 · · Score: 2

      I'd appreciate a link to that, but it probably won't sway me. After all, what about the thousands who will die because we'd be taking away their benchmark for smoke alarm battery changing... ;-)

      (Seriously though, a link or two would be cool, google didn't turn up anything interesting so I'm wondering if you got scammed. I only found a single reference to a 7% increase in 'the monday after the april change' traffic accidents, but that certainly wouldn't account for "a few thousand people" nor was the reference any kind of controlled study that would include the costs of increased pollution, kids getting hit in the dark walking to and fro school and the rest of the flavor of thing)

      Why is it too much to expect that people turn their brains on, fire a few neurons, and produce cogent thought? DST is yet another example of, "It *feels* good so it must the right thing to do."

      Indeed! We should ask those people to get a good nights rest before driving to work Monday morning!

      Oh, I guess that's not what you meant. I suppose personal responsibility is only useful when it supports *your* argument. ;-)

    10. Re:I guess that's what you get.... by battjt · · Score: 2

      In college, I often worked through the change of the day. It wasn't nearly as confusing as figuring out what time it is in California when you live in Indiana.

      I would know that it is 19:21 Oct 10 and that my friend in California gets to work at 19:00 GMT and leaves at 3:00 GMT the next day.

      Joe

      --
      Joe Batt Solid Design
    11. Re:I guess that's what you get.... by crath · · Score: 3, Informative
      A couple of links:
      Accident rates increase in response to DST---Stanley Coren of the University of British Columbia
      UK government's Transport Research Laboratory numbers---the practice of turning the clocks back had led to 3,000 deaths on Britain's roads in the last 30 years

      Lastly, my feel good comment was in relation to the extra hours spent on the golf course. It was a bit of a flame and I probaby should have deleted that comment before posting.

    12. Re:I guess that's what you get.... by rw2 · · Score: 2

      Ok, thanks for the links. They don't address at all the idea that these are 3,000 *extra* deaths in 30 years though, just that they claim a measurable difference in one kind of death.

      I still wonder if the overall picture isn't precisely the opposite.

    13. Re:I guess that's what you get.... by Anonymous Coward · · Score: 0
      Further, DST has no energy saving benefits when the daylight hours are less than waking hours. Instead, we must wake up in the dark during the coldest hours of the night, turn on the lights, and crank up the furnace. That does not save energy!

      The benefit of DST occurs only when dawn is before waking hours for most people. It makes sense to start it in late April, but no sense to continue it to the end of October. Labor Day weekend (early September) would be a much more appropriate time to revert to standard time.

      At this time of year, I really appreciate the common sense of you folks in Hawaii, Arizona, and Indiana!

    14. Re:I guess that's what you get.... by Anonymous Coward · · Score: 0

      No doubt. IIRC, my cousins lived in one time zone and their school (in the same town) was in another time zone. But they're like 15 years older than I am, and I heard about this when I was very young so maybe I'm wrong. Then again I looked on the link you provided, and they were in Bright (which is in Dearborn county) so it's probably true.

  8. Why? by Anonymous Coward · · Score: 0, Funny

    "Are even technical users ignorant on how UNIX handles time, time zones, and time conversion?"

    Why are you asking here at slashdot about the knowledge of technical users?

  9. date -s by 4of12 · · Score: 1

    I can recall some really screwy things happening to make if you muck around with date -s as root. Stale files being up to date, other files being created in the future. I'd imagine Daylight Savings would be similar in some ways.

    Isn't there some standard we could all agree upon, such as dates and times will be translated at submission time into GMT and cron jobs be run at whatever local time maps to the corresponding GMT? Then, if you want make local time jump around, fine, it's your own responsibility if you like discontinuous time (kind of like heavy drinking).

    There's still probably room for ambiguity with all these "leap seconds" I keep hearing about...

    --
    "Provided by the management for your protection."
    1. Re:date -s by duffbeer703 · · Score: 3, Insightful

      The world already has a standard -- UTC.

      System time should be set to UTC, and the time display should be seperate configuration step.

      Using NTP should take care of the leap second problem, as long as your Stratum-1 server is accurate.

      --
      Conformity is the jailer of freedom and enemy of growth. -JFK
  10. NTP by stu72 · · Score: 2, Informative

    Why not just run an NTP client on the box? Then you get accurate time and spring/fall time changes automatically.

    1. Re:NTP by BlueUnderwear · · Score: 4, Informative
      Why is this drivel moderated at 4?

      First, NTP does not affect spring/fall time "changes" at all. Regardless of whether you have NTP or not, this "change" happens correctly. Indeed, daylight saving time only affects how time is displayed (or broken up in day, hour, minute, second), and does not affect the physical clock at all (which is kept in UTC at all times). NTP however, ensures accuracy by synching the physical clock (kept in UTC) to a master.

      Moreover, the subject of this discussion is not the accuracy of the displayed time, but rather how cron (which works in local time) copes with with "duplicate" and "missing" hours. Installing NTP does nothing to help this, only picking the right cron works. Or just use the commonsense solution of not scheduling any important jobs between 2am and 3am.

      --
      Say no to software patents.
    2. Re:NTP by stu72 · · Score: 2

      Oops.. you're right.. I misread the question.

  11. In FreeBSD... by cperciva · · Score: 5, Interesting

    In FreeBSD, the default times for daily/weekly/monthly cron jobs are chosen so that they don't fall within the daylight savings time mess.

    1. Re:In FreeBSD... by mosch · · Score: 3

      Also, in FreeBSD you get a choice of whether to handle changes in GMT offset in an intelligent way or not. -o gives the old behaviour, -s makes it smart.

  12. Time zones by sql*kitten · · Score: 3, Informative

    Are even technical users ignorant on how UNIX handles time, time zones, and time conversion?

    Maybe this has been fixed by now (AFAIK as of SunOS 5.8 it hasn't) but Unix' handling of timezones has always been pretty lame. For example, if you want to change timezone in your shell (and for processes subsequently spawned) you just set the TZ environment variable. If you want to change the system time globally, su to root and use the date command, and running processes will see it next time they ask the OS for the time. OK so far. But if you want to change the timezone globally, for running processes, you can't because time zone comes from init - at the very least you have to stop and restart processes after setting TZ, and if you're going to do that, you might as well edit /etc/default/init and reboot!

    1. Re:Time zones by bbc22405 · · Score: 2, Insightful
      But if you want to change the timezone globally, for running processes, you can't because time zone comes from init - at the very least you have to stop and restart processes after setting TZ, and if you're going to do that, you might as well edit /etc/default/init and reboot!

      If your Unix box is wandering about the globe, powered, running, changing timezones willy-nilly, please do consider selecting some sort of generic time zone for the system, one that you won't feel compelled to change system-wide. Other people have mentioned GMT and UTC.

      For the user, simply changing the TZ variable should mostly have the desired effect.

    2. Re:Time zones by sql*kitten · · Score: 1

      If your Unix box is wandering about the globe, powered, running, changing timezones willy-nilly, please do consider selecting some sort of generic time zone for the system, one that you won't feel compelled to change system-wide.

      Unfortunately, it's a test rig for a date and locale sensitive application - timezone needs to be changed frequently system-wide as part of testing (the machines themselves are physically static :-) ).

  13. Daylight Savings? Blech by Eponymous,+Showered · · Score: 4, Funny

    Just have your company relocate to Indiana. We don't need no steenking daylight savings.

    1. Re:Daylight Savings? Blech by dondelelcaro · · Score: 1
      We don't need no steenking daylight savings.
      Too bad part of Indiana observes DST and part of it doesn't, which just makes things even more confusing.
      --
      http://www.donarmstrong.com
    2. Re:Daylight Savings? Blech by /dev/trash · · Score: 1

      or Arizona or Hawaii.

    3. Re:Daylight Savings? Blech by dp_bluegreen · · Score: 1

      Move to Indiana? That's the most DST-schizo state in the U.S.! Most of the state follows EST, but the area near Chicago and around Evansville, IN is in Central time. And other sections near Ohio and Kentucky are in Eastern time (including EDT during the summer). Move to Arizona or Hawaii.

    4. Re:Daylight Savings? Blech by clifyt · · Score: 2

      Yup....not very confusing what so ever.

      The places in Indiana that don't change their times are the ones that are more associated with areas outside of Indiana. For instance, Gary, while being one of the largest populated cities in the states is NOT considered an Indiana city by the majority of the populace. Its considered an ugly extention of Chicago and most of our politicians view it that way as well.

      Some of our my farm oriented area neighboring other states change because they have to do business with others that are a little more inflexible and haven't learned that in this modern age, face time is not as valued.

      I love living in Indiana. I like the fact that it gets darker earlier in the winter months. You really don't get anything more or less done than before. I like the fact that we don't change an artifical number just because it matches some number based on nature. Maybe I'll change my mind when clocks get smart enough to subtract 3 minutes a day 6 months of the year and adds another 3 back every day the others (if I did my math correctly) to be more attuned with nature, maybe I'd allow for daylight savings.

      clif

  14. Grammar Nazi Time by zsazsa · · Score: 4, Informative

    Okay, this has to be the absolutey most assinine thing I've done on Slashdot, but I've gotta do it.

    It's daylight saving time, not daylight savings time. NIST says so.

    Anyway, if it were up to me, we wouldn't have daylight saving at all.

    1. Re:Grammar Nazi Time by zsazsa · · Score: 2, Funny

      (Joke's on me -- I misspelled asinine.)

    2. Re:Grammar Nazi Time by Anonymous Coward · · Score: 0

      the joke is indeed on you!

      the standardtime.com site proposes 2 timezones for the entire continental US. now _that_ is asinine!!

    3. Re:Grammar Nazi Time by flossie · · Score: 1

      absolutey ;-)

    4. Re:Grammar Nazi Time by Anonymous Coward · · Score: 0

      I was gonna axe you if it was the first way or other way.

    5. Re:Grammar Nazi Time by AndrewRUK · · Score: 1

      (This post is going to make you wish there was a "Pedantic" mod option...)

      But you were being a grammar Nazi, not a spelling Nazi, so spelling mistakes are (possibly) allowed...

    6. Re:Grammar Nazi Time by Anonymous Coward · · Score: 0

      If it were me, we would all be on UTC 24 hour clock time. Saves a lot of confusion across time zones.

  15. Not really unaware by dacarr · · Score: 2, Informative
    I learned to be aware of the problem the hard way one year. I had adjusted PDT->PST on my watch in 1998 at 00:30 PDT, making it 23:30 on my watch again. The problem remained when I had forgotten to adjust the day back one increment, so when Tuesday came around (the day I was to go back to work), I had thought I missed a day of work.

    Now I am very careful about what cron jobs I run between 01:00 and 03:00 on any unix box (they might check for the existance of something at most), and accordingly leave ntpd running.

    --
    This sig no verb.
  16. Dual boot? by Gerry+Gleason · · Score: 3, Interesting
    Of course, this is the right solution, and it is probably universal for UNIX vendors (Sun, HP, IBM, ...), but when your running on PC hardware there are extra considerations.

    Linux gives you a choice about how to keep the hardware clock (Local or UTC), and the system clock is UTC with an offset setting for local time. If you're single boot with Linux, a UTC hardware clock is probably best, but if you ever want to boot into Windows, your going to have to adjust somehow.

    Having the hardware clock in local time creates a problem when the time change happens, but you don't see it until you reboot. Someone incorrectly said you need to update from the hardware clock, but it is just the opposite, you have to update the hardware clock from the system clock after the time change. Since the system knows both when the change happens and whether the hardware clock is in local or UTC, it could take care of this little detail. It would be a nice touch for the distribution makers to handle this is some way. This is one of those things that doesn't really live in a single program/module but relates to interactions, so the distribution maker probably should own it. Of course, it would be nice if the hardware clock knew what the current offset is, then the issue would be easily and correctly solved.

    BTW, I've always wondered about how the transition day is calculated. I've never been able to find a simple description of it. Most (all?) systems seem to know when it is, and it allways seems to be correct (for US timezones excluding Indiana), but I can't see how it could be 'calculated' from a simple rule that doesn't need to be updated from time to time. The TZ variable indicates whether the zone has DST and what the offset change is, but it doesn't have any information about when the change is. Is it just a 'last Sunday in October/April' or something like that hard coded in the library?

    1. Re:Dual boot? by lewiscr · · Score: 3, Informative
      BTW, I've always wondered about how the transition day is calculated. I've never been able to find a simple description of it.
      *snip*
      Is it just a 'last Sunday in October/April' or something like that hard coded in the library?

      Depends on the Country and the Hemisphere. The US (and most of North America) is first sunday in April and last sunday in Octoboer. I didn't realize that the Southern Hemisphere observers DST the other six months (ie, their summer). Seems obvious in hindsight.

      Web Exhibits has history and start/stop days by country.

      I shamelessly stole a bit of DST calculation code from their web site.

    2. Re:Dual boot? by the+hopthrisC · · Score: 1

      The day is set arbitrary by some committee or other for the next few years. AFAIK, talks are in progress to drop the whole braindead idea of daylight for good, next time around...

  17. The Y2030 "Bug" by greenhide · · Score: 2

    According to most things I've read, computers that count upwards from 1970 are doomed to have their date information run out in the year 2030. Has any though been made about how that conversion is going to be made?

    One thing about the whole Y2K thing--proves just how into themselves geeks are. Uber programmers were going on about a post-apocalyptic type situation, but even in developed countries where little or no Y2K fixes were made, things went just fine.

    --
    Karma: Chevy Kavalierma.
  18. Re:The Y2030 "Bug" by pne · · Score: 3, Informative

    2038 is more like it. 03:14:07 UTC on 19 January 2038, to be exact.

    And no, just hoping everyone's going to be running 64-bit systems by then is not going to help if you have, for example, file formats which only allocate 4 bytes to storing a time_t value.

    I'll not have reached retirement age in 2038... I wonder how many C programmers will be called out of their holes to patch programs similar to the hunt for COBOL experts at the end of last century.

    --
    Esli epei etot cumprenan, shris soa Sfaha.
  19. This is good stuff. by Anonymous Coward · · Score: 0

    I was the AC who originally submitted the article. (I had to AC to remove any connection with my company, which wouldn't have authorized asking in public with their name attached.)

    I think the greatest surprise here is that cron behavior is inconsistant across platforms. The systems I looked at did the twice-or-never routine. (I did come across an old bug in BSG that did a twice-or-once instead!)

    But I think it is important to understand how, not only is there a problem in the way people perceive that cron handles it, but that it handles it differently here and there. It certainly makes the problem messier. You'd think it would be standardized.

  20. I live in Saskatchewan by Anonymous Coward · · Score: 0

    Never changed times, never will.
    I don't understand this stupidity of daylight savings time. Just accept it...during the Winter, Sunrise is at 8am, Sunset at 6pm and during the Summer, Sunrise is at 5am, Sunset at 9pm. Accept nature's natural cycle. Don't start f**king with the clocks to make it appear that you somehow have more daylight now...you don't!

    Thomas Dz.

  21. Re:The Y2030 "Bug" by John+Hasler · · Score: 2

    > And no, just hoping everyone's going to be
    > running 64-bit systems by then is not going to
    > help if you have, for example, file formats which
    > only allocate 4 bytes to storing a time_t value.

    If you are storing time_t in files as an int you deserve what you will get.

    > I wonder how many C programmers will be called
    > out of their holes to patch programs similar to
    > the hunt for COBOL experts at the end of last > > century.

    About one. The problem, if any, is trivial compared to the COBOL one.

    --
    Warning: this article may contain humor, sarcasm, parody, and perhaps even irony. Read at your own risk.
  22. Re:The Y2030 "Bug" by pne · · Score: 2

    If you are storing time_t in files as an int you deserve what you will get.

    And what about those who store time_t as a time_t? On the systems I've seen, time_t is a long, which is most often 32 bits. Setting up a file format around that seems the "obvious" thing to do.

    While it's true that thinking ahead makes sense, people tend not to do so if the "obvious" solution works (and will continue to work for over thirty years, by which time they hope they'll be retired).

    I wonder how many C programmers will be called out of their holes to patch programs similar to the hunt for COBOL experts at the end of last century.

    About one. The problem, if any, is trivial compared to the COBOL one.

    I'd not be so sure. I can well imagine that in a bunch of places, there's just not enough space to store the extra bits, just as in the Y2K problem people had to scare up an extra two bytes in all sorts of places to store the century... which is not so good in, say, protocols which have fixed field widths. I don't think it's something trivial which can be fixed by just recompiling everything (which in itself is not trivial -- you'd really need to test the software all over again to check that you didn't break anything by compiling with wider integers).

    --
    Esli epei etot cumprenan, shris soa Sfaha.
  23. OpenBSD cron by Anonymous Coward · · Score: 1, Informative

    If time has moved forward, those jobs that would have run in the interval
    that has been skipped will be run immediately. Conversely, if time has
    moved backward, care is taken to avoid running jobs twice.

    *BSD's rock!!! :)

    1. Re:OpenBSD cron by Anonymous Coward · · Score: 0

      But *BSD is dying. Haven't you heard? Sheesh... kids these days.

  24. UTC by mirabilos · · Score: 3, Interesting

    Servers ought to use /usr/share/zoneinfo/right/UTC
    anyways because of the logs and stuff, and me, being
    consistent, despite living in right/Europe/Berlin zone,
    switched all my clocks (server, desktop, notebook,
    watch, wrist clock, microwave oven clock, car clock
    etc.) to UTC. I just add the one or two hours in mind.

    --
    My Karma isn't excellent, damn it! (And /. still does not get UTF-8 right in 2012. Wow.)
    1. Re:UTC by __aaahtg7394 · · Score: 2

      in the states, it's a little trickier, as we aren't just one or two off, but a full 5-8. it's annoying to work with the numbers from that. one or two are easy, more than 4 is difficult for me (i spent the summer in Europe, being able to go from greece to france with only one hour's difference was nice).

  25. Indiana Changes Time by fm6 · · Score: 2

    Not correct. Indianans all set their clocks to GMT minus 5 hours. Solar time for Indiana is closer to GMT minus 6 hours, with a 20 minute variation from east to west (unless I've screwed up the math, entirely possible). Like everybody else in this industrial age, Indianans ignore the sun and use a convenient time standard instead. The Indianan standard is just a little simpler than most.

    1. Re:Indiana Changes Time by Anonymous Coward · · Score: 0

      People from Indiana aren't 'Indianans', they're Hoosiers. Really.

  26. Re:The Y2030 "Bug" by randombit · · Score: 1

    And no, just hoping everyone's going to be running 64-bit systems by then is not going to help if you have, for example, file formats which only allocate 4 bytes to storing a time_t value.

    Most file formats that I've seen (such as OpenPGP), define the time as a 4 byte UNSIGNED value, which will work until 2106 (if I'm calculating that correctly). The odds that any file formats today will be in use by then is pretty freaking small. Anyway, I'll be 125 (long retired or long dead) at that point, so I'm not worried.

    In fact there is no problem with defining time_t as an unsigned int. time()'s is defined as returning (time_t)-1 on error -- this works regardless of time_t's signedness.

  27. Yes by wdr1 · · Score: 2

    Are even technical users ignorant on how UNIX handles time, time zones, and time conversion?

    Yes, so share your report with us, at least summerize it.

    Will simply avoiding scheduled jobs between 2 and 3am solve most of our problems?

    -Bill

    --
    SlashSig Karma: Excellent (mostly affected by moderatio
    1. Re:Yes by jareds · · Score: 2

      Will simply avoiding scheduled jobs between 2 and 3am solve most of our problems?

      If your goal is to avoid the DST crossover, you should avoid 1am to 3am because it changes from 2am to 3am in the spring and from 2am to 1am in the fall.

  28. Maybe Linux/Unix/etc. should take notes from VMS by moldar · · Score: 2, Interesting

    Having been involved in some Time Change projects at work I was impressed to hear how the VMS system handled the time change. Instead of having a big jump in the time they slew the clock over the course of 6-12 hours. That way it lets all the jobs run with times that are 'close enough' without having to worry too much about the special cases. Just my $0.02

  29. Re:The Y2030 "Bug" by Anonymous Coward · · Score: 0

    Hmm...

    1) systems using a signed 32 bit (31 bit effective) offset in seconds from Jan 1 1970 GMT will overflow around 2030.
    2) 32 bit systems will hopefully be rare enough by that time that using a 64 bit offset will be cheap
    3) The Y2K scare was more of a media, grandma-watching-CNN, and expensive COBOL analyst driven thing than a geek thing. I made several bets with less informed people that there would be no problems worth noting... I never got my money.

  30. Windoze by linuxwrangler · · Score: 3, Funny
    All this reminds me of the guy doing a writeup on the then-new Windows 95 years ago. He was apparently trying to get his article in on deadline when it became time to "fall back". He wrote that he was impressed by the fact that Windows told him that the time had changed back and asked if he wanted the computer's clock reset.

    He answered "yes" but became rather less impressed an hour later when, once again, it asked him if the clock should be reset. For fun he kept answering yes each hour till he was done with his article.

    Database, cron and other timezone problems aside, at least a properly set up *nix always knows what time it is both locally and in UTC so the other programs at least have a shot at running properly.

    --

    ~~~~~~~
    "You are not remembered for doing what is expected of you." - Atul Chitnis
  31. Re:Maybe Linux/Unix/etc. should take notes from VM by cs668 · · Score: 1

    Unix/Linux can do this with adjtime, but for daylight saving time that seems like the wrong behavior. This is normally how things like ntp keep the systems time in check without having jumps.

    But, daylight saving time is really a jump and I wouldn't want my clock to say 8:30PM at 8:00

  32. You guys are confused... UNIX always uses GMT (1) by m.dillon · · Score: 2, Insightful
    Internally UNIX always uses GMT (1), period. time() always returns epoch time. It is not effected by daylight savings time or zone changes. NTP keeps epoch time in synch. It is not effected by daylight savings time or zone changes either.


    Your time zone preference can be set on a shell-by-shell basis or process-by-process basis using the TZ environment variable. The system has a default preference that is typically /etc/localtime. In short, the system doesn't care what your preference is. The preference only effects display representations, it does not effect the underlying timekeeping.


    Programs can choose to use whatever timezone they wish independant of any preference. It just so happens that cron defaults to using the system local time preference but nothing prevents you from changing that if you don't like it. In fact, many cron's allow you to set the time zone you want to specify your jobs in on a user-by-user basis. So if cron's skipping around is bothering you, just switch it to GMT (1).


    (note 1: well, it's either GMT or UTC, I forget which. There are subtle differences)

  33. Come to a real state... by Anonymous Coward · · Score: 0

    Like Arizona. None of that wishy-washy part of the state does one thing, part of the state does another. It's no daylight saving for ANYONE! Half the cheer, you chill with the other Mountain TZ'ers, and then, they all shift, and you're left chilling with the Pacific. It's all good!

    Oh, except for the fact it really screws up TV schedules. You never have any idea when any cable program will actually be on.

  34. Hillbillies by Anonymous Coward · · Score: 0

    Yeah, you Indiana people are really cutting edge.

  35. Not having DST is Weirder by MyHair · · Score: 2

    I moved to Indiana a year ago after living my entire life in DST zones, and I thought not having to worry about DST would be nice.

    But it's actually weirder because the rest of the (preceived) world goes on DST.

    Sporting events happen at different times, TV shows air at different times (and there is discrepancy between cable & broadcast times), and scheduled work conference calls change times.

    If you think forgetting to set one or two of your clocks back is a pain, try having half of your daily schedule change times and keep straight what changes and what doesn't.

    As far as the article goes, admins may not need to understand the technical details of what cron does two hours out of every year, but they sure as hell had better know if their backups and periodic maintenance is getting done!

    Then again in cases I've worked missing one backup wouldn't be critical.

  36. The real problem is... Y10K by Anonymous Coward · · Score: 0

    Oh sure, it's still 7998 years away, and that SEEMS like a really long time, but it's really not. Pretty soon, it'll be 9999 and everyone will be running around looking for COBOL programmers who can update their software to support 5 digit years.

  37. zoneinfo by trouser · · Score: 1

    man 3 time
    man localtime
    man tzset

    Download the Zoneinfo source from ftp://elsie.nci.nih.gov/pub
    You'll need to grab the latest versions of tzcode and tzdata. Just read the docs and source comments to learn more about time zones and daylight savings than any right thinking person would ever need/want to know.

    --
    Now wash your hands.
  38. Your company must have nothing for you to do by The+Analog+Kid · · Score: 1

    Writing a report on Day Light Savings Time, well either your company has nothing for you to do, or you finish your work way to quickly.

  39. DST is backwards by Fastball · · Score: 2

    We should be moving the clock forward in Fall and back in Spring. I fucking hate sunlight in the morning and having it taken away from me in the evening. I rather like waking up and going to work in the dark. Plus, the more light I have in the evening, the longer I can ride my bike. Why are we doing it backwards?

  40. Daylight time doesn't matter with UTC by ptudor · · Score: 2, Informative
    Why bother worrying? Run your system using UTC entirely and just set the TZ variable in your shell. It's not really that hard to add or subtract an oftentime single digit number to find the time relative to you. (and when you're lazy, gdate -u is a quick doublecheck)

    Other benefits of UTC? A central logserver taking logs from hosts across the continent. "Was that at 2 Central or Eastern? Wait, what time is it in Indiana right now?" Additionally, when you have users across the world it provides a common time. I've meet many people who thought that the common Eastern timezone was still EST in the summer and never used EDT. Once again, Indiana: in the summer, it's the same as CDT, but it's still EST (unless you're near a major city on a border, in which case the appropriate [CD]DT is used). Don't add this confusion to your system accounting.

    Using UTC as a common reference time for computing devices simplifies the maintenance of them and eliminates any potential problems originating from the use of local daylight time.

    heheh because I'm on Pacific time, all the cron mail sent out at midnight shows up early in the evening. A side benefit.

    (And NTP! Please! Accurate time is key to accurate forensics in the event of an intrusion crossing multiple boxes. Even the MacOS and XP have built-in support.)

  41. move your systems to Arizona by Anonymous Coward · · Score: 0

    i know plenty of people out of work that would love to see an increase of systems here =)