Re: gettimeofday() seems to return local time
Re: gettimeofday() seems to return local time
- Subject: Re: gettimeofday() seems to return local time
- From: Mike Smith <email@hidden>
- Date: Mon, 6 Dec 2004 11:46:20 -0800
I'm using gettimeofday(), on OS X 10.3.6, to get the time resolution I
need (milliseconds).
If I'm reading the documentation right, I should be getting time in
UTC. However, I'm getting local time.
Should gettimeofday() return local time?
No.
Check that you have correctly set the timezone. Try comparing the
output of
# date
and
# date -u
to make sure that the system has an idea of local time that varies from
UTC.
Will it work the same on all Macs?
The system call gettimeofday(2) should behave consistently across all
MacOS X versions.
Will it change with future releases of OS X?
Given that the gettimeofday(2) interface dates from 4.2BSD and with the
exception of the removal of timezone information has remained unchanged
for more than a decade, I find it highly unlikely.
= Mike
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden