TZ

Simon Bowring pmmail@rpglink.com
Mon, 20 Mar 2000 15:51:49 +0000 (GMT)


>Or are you saying there is some physical restriction that stops you 
>from entering whatever time you want in these operating systems? 
Ovbviously you can enter any time you want, but if you software
that is timezone and Daylight Savings Time aware, then it will
not show the correct times , dates and time differences unless
you set the RTC to local time and set TZ correctly.

>Or some reason why we NEED to continue using the (inferior) system 
>that DOS introduced?
Yes, the reason is that's how the C runtime libraries for OS/2 (and
DOS and Windows) are coded to work, and since you can't change 
programs that were written in the past (some in MS and Watcom
C/C++ which you can't even get anymore), there is no other choice!

If you want to be able to calculate the time elapsed between 
two date'n'times, or you want to have Timezone and/or daylight savings 
time support (required for news and email), you have *no choice* under 
OS/2 and Windows but to run your RTC in local time, the C run-time 
library is then able to calculate what UTC is from the TZ variable.
To do otherwise will make your software get "the wrong answer" under 
certain circumstances.

In a non-networked environment with no daylight savings time, your
system of using the RTC configured to UTC will give consistent 
results, provided you are happy to work in UTC yourself.  Your
critisms of ODs clock is based upon the false perception that
OS/2 supports working in UTC and converting to localtime.
It doesn't and never has done!

The C runtime libraries from MS, Watcom and IBM which I am familiar
with, have no support for PCs that have been configured to run in 
UTC and then use TZ to calucate the local time (as is done on 
traditional unix systems)!

For example, when daylight savings time changes, it can be
2 o'clock in the morning twice, once at 2am, and the other one
second after 02:59:59. How many seconds have elapesd between these 
two "2 o'clocks"?  The answer isn't zero, it's 3600.  Without 
timezone  and daylight savings time support, this calculation cannot 
be made to work.


Regards

Simon Bowring,                   | http://www.mpc-data.co.uk/
Senior Software Engineer,        | Tel: +44 1225 868228
MPC Data Limited                 | Fax: +44 1225 868191