[phobos] datetime review

Sean Kelly sean at invisibleduck.org
Sat Oct 9 10:39:44 PDT 2010


On Oct 9, 2010, at 4:29 AM, Jonathan M Davis wrote:

> On Saturday 09 October 2010 04:16:59 Michel Fortin wrote:
>> Le 2010-10-09 à 1:47, Jonathan M Davis a écrit :
>>> Which is why PosixTimeZone and WindowsTimeZone will be getting that
>>> information from the OS, but the OS does not make it easy. On Posix, you
>>> have to actually read in the time zone files from disk, and on Windows,
>>> you have to read the registry. No system calls are provided to properly
>>> deal with time zones. Honestly, time zone support for anything other
>>> than the local time zone is very poor on both Posix and Windows systems.
>>> And Windows won't even let you set the time zone for your program
>>> without setting for the whole OS. It's not a pleasant situation really,
>>> but I hope to be able to overcome it well enough that D programmers
>>> won't have to worry about it.
>> 
>> I had the "pleasure" to work with time zones on Windows once, what a mess!
>> 
>> On OSX, Cocoa has an API for that, but you can probably get it the posix
>> way too.
> 
> I wasn't aware that there was an API. I either need to use the API (at which 
> point, I'd end up with a MacOSXTimeZone in addition to PosixTimeZone and 
> WindowsTimeZone), or I need to know where the time zone files are in Mac OS X. As 
> I understand it, Mac OS X does use the same time zone files as Linux, but I don't 
> know where it keeps them. Linux uses /usr/share/zoneinfo, but I have no idea if 
> Mac OS X even has /usr, let along /usr/share/zoneinfo.

It does.  OSX is based on BSD so the directory structure is pretty standard.  All the OSX-specific stuff lives in a parallel directory structure.


More information about the phobos mailing list