RE: [PHP-DEV] Upgrading to internal DateTime

From: Date: Fri, 05 Dec 2008 12:07:31 +0000
Subject: RE: [PHP-DEV] Upgrading to internal DateTime
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-42115@lists.php.net to get a copy of this message
> -----Original Message----- > From: Lester Caine [mailto:lester@lsces.co.uk] > Sent: 05 December 2008 06:24 > To: internals@lists.php.net > Subject: [PHP-DEV] Upgrading to internal DateTime > > OK I spent yesterday working trough some of the > idiosyncrasies of DateTime and having had a sleep I've > finished off this morning. > > First question. > Why are there two different formats for dates with date > creation using one format and everything else using strftime > formatting? > ( Slipping a date through DateTime and returning it DATE_W3C > seems to be adding the correct daylight saving details so far > and allowing ADOdb date to work ) > > Second question. > What is the current situation on translating dates? I've > tried several ways of using setlocale, but at present I've > not been able to get anything other than English out of the code. Intl extension has classes/methods for translating dates. http://www.php.net/manual/en/class.intldateformatter.php . > > Third question > In order to get things working I've ended up with > date_default_timezone_set() and haven't needed to use > DateTimeZone at all ( other than to get a list for the user > to select from ). Internally we are working UTC normalized, > and then displaying with the user offset if they select > 'local'. IS the correct thing to be setting the default for > each user? I suspect yes since previous code has always had > to fight the server time setting changing things. Jared

« previous php.internals (#42115) next »