Subject: Re: QUESTION: Daylight savings, and how to control it Here is another question where you can go ahead and let your creativity run away. Although Rube Goldberg solutions are welcome, they may not be reflected in the summary :-) We have an application running on our Solaris 2.8 machine, and we need it to be unaware of daylight savings time changes. In other words, for our intents and purposes, in the middle of our application running, it would be REALLY bad if all of a sudden we went backwards in time, or skipped an hour. What I need is someway to prevent the application (getting it's time reference from system time through Java system calls) from automatically jumping ahead or behind. When the application restarts, or if the system is rebooted, that is fine if the date is adjusted accordingly. Actually, everytime the app is restarted we run ntpdate to get the latest date for the system clock. I realize that the system time never actually changes, it is simply the way that date, ls, etc. calculate it. But is there somewhere those programs look that I can alter on my own so I can make them change at my leisure? I guess what I am trying to figure out is if there is some way to say "I realize a daylights savings time change has occurred, let's just wait until we are finished to acknowledge it" or "Daylights savings events never occur, until I run my script and check for them, and reset some values somewhere for the calculation to be correct" Any ideas? Can I turn off daylights savings functions altogether and rely solely on ntpdate, or is that just a GMT +- offset, then set the time type function? ================================================== I would like to thank all those people who offered suggestions on how to fix this problem. This is going to be a long e-mail, and hopefully exhaustive of all the avenues I tried, and why a majority of the solutions provided didn't actually solve this problem. The original problem wasn't that I had to completely ignore the daylight savings switch, I had to delay it from happening. Many of the solutions that I received were simply to select a time zone that never reflected the switch to and from daylight savings time. That would work just fine, except for the fact that half of the year, the clock would be an hour off. I think through my mis-communication I eluded to "ignoring" the switch, when I should have actually made reference to "delaying" the switch. However, some people did offer the suggestion of the rtc command. I looked, and sure enough, there was a crontab entry for rtc. According to the manpage, this is the program (run at 2 am on sundays) that alters the calculated clock. It also appears as though it is also called when date or an ls is executed to verify the correct time is being displayed. I removed this entry from my cron, and then actually moved the file (rtc) out of the way (to ensure nothing else was calling it), and the clock still jumped around (I am using 10/28/2001 @ 6:00am GMT and 04/01/2001 @ 7:00am GMT for my tests) as if rtc wasn't really a factor. The other odd thing is that I never saw a log entry in the cronlog for rtc running. How the time was modified without the presence of rtc, I am still a bit unclear. Alas I digress. The testing that I used was mostly simply. I ran xclock in xwindows, and then I ran a Java clock which created a new Date object every .5 seconds and asked it for the time. In all these cases the time jumped around. ==================================================== Other questions: Why do I need to do this, and why can't I just use GMT? The time does need to match the clocks in the room while this is all happening. Lets say that I am using this system in operating room. I can tell you that in the middle of the operation, they aren't going to come in and reset all the clocks (but they will once the operation is done). Why can't I jump immediately when this happens? If all of a sudden we jump an hour, it could look like it has been 2 hours since something happened when in actuality it only happened an hour ago. Morphine is good, just not THAT good. I can't use GMT, because that isn't what they use in the OR. I have to make sure that I do deal with Daylight savings because I can't have this system being an hour off from all the other systems. ==================================================== Who is Rube Goldberg: See.. How to use a search engine. ==================================================== In final, I guess you can tell from this summary and the previous question that I am trying to do this with Java. I think it is becoming apparent that this is more of an application problem then a Solaris problem. In that I need to make sure that what ever calculations the system/application is doing to get the current local time are suppressed until such time as I want them to occur. If I missed anything, please feel free to bring it to my attention. Thanks much! --Brett M ThorsonReceived on Thu Apr 26 22:33:21 2001
This archive was generated by hypermail 2.1.8 : Wed Mar 23 2016 - 16:24:53 EDT