site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com On Dec 2, 2004, at 4:09, share-darwin@think42.com wrote: On Dec 1, 2004, at 14:57, Michael Rubinstein wrote: If I'm reading the documentation right, I should be getting time in UTC. However, I'm getting local time. As I read the man page, you should get the local time in *tp, and the offset from UTC in *tzp. Regards, Justin _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... On Wed, Dec 01, 2004 at 03:39:14PM -0800, Justin Walker wrote: I'm using gettimeofday(), on OS X 10.3.6, to get the time resolution I need (milliseconds). Should gettimeofday() return local time? Yup. Hm, my reading of the Solaris, Linux and Mac OS X man pages is that the time returned should indeed be UTC ... the former two explicitly mention UTC, the Mac OS X page speaks of "current Greenwich time", which I would interpret as "old" UTC. I don't think you are reading it correctly. The man page does mention "current Greenwich time", as you say, but in more detail: The system's notion of the current Greenwich time and the current time zone is obtained with the gettimeofday() call, and set with the settimeofday() call. The time is expressed in seconds and microseconds which I take to mean that you can get either. If you include a non-null *tzp, you get the local time, with the tz struct giving you the offset (from UTC/Greenwich). -- Justin C. Walker, Curmudgeon-At-Large * Institute for General Semantics | It's not whether you win or lose... | It's whether *I* win or lose. *--------------------------------------*-------------------------------* This email sent to site_archiver@lists.apple.com