time.h & timezone help
time.h & timezone help
- Subject: time.h & timezone help
- From: Xochitl Lunde <email@hidden>
- Date: Fri, 27 Mar 2009 18:09:38 -0500
I have a c++ program which uses the
definitions 'timezone' and 'daylight' from 'time.h'. My program is a simple
test ported from Linux which checks the 'timezone' and 'daylight' values
and then adds them together to find the difference from UTC. My
Mac is set to Chicago timezone.
When I use my Mac to check 'timezone'
it comes back with a value of 5, and 'daylight' has a value of 1. Shouldn't
'timezone' have a value of 6 ( or -6) in Chicago?
If I change my Mac to Mexico City location,
then my Mac 'timezone' has a value of '6' and daylight value of '1'.
Many pardons for comparing, but if I
set my Linux computer to use time.apple.com for NTP, the 'timezone' comes
back with 6 and 'daylight' a value of 1 whether I choose Chicago or Mexico
City. Both computers show the same time on the clock when they are
set to the same location, so at least whatever runs the clock on the OS
desktop is working correctly.
Does the Mac already correct 'timezone'
for daylight savings time? Where should I have been reading to learn
about this? I tried opening the 'time.h' file in the SDK /usr/include
directory, but I did not notice any obvious comments near 'timezone' -
I wouldn't really expect to, as Mac is not linux... Is there some
other way that I should be checking this? I would rather not have
to add in a framework if I can get around it - I know I will need frameworks
for other things, but I'm trying to keep this x-platform code as clean
as I can.
My understanding here seems to be flawed,
as I would think 'timezone' would not be corrected for daylight savings
time because there is the 'daylight' variable exposed for applications
to use.
Thanks,
Xochitl _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden