Re: DateTime improvement

From: Date: Sun, 16 Dec 2012 13:46:48 +0000
Subject: Re: DateTime improvement
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-64298@lists.php.net to get a copy of this message
I'm not really against that, but we do need to use the Date namespace -
so DateTimeImmutable. It might be trickier to do than it sounds though...
I've started hacking on this - with some luck I'm done before PHP 5.5 beta1.
Am I missing something here? Isn't this just making the object content read only? Haven't we been having a separate discussion on that? On the whole I'm only using DateTime objects when I need to display the content in a different timezone, so the timezone needs to be changeable, but the base date is read only. Alternatively I'm building a calendar so need 'all the days for month x' as an array, and then use those dates to generate the database query. If it's a 'local' calendar then there will be a time offset incorporated as well. In Firebird, the dates are stored as a numeric value, with the whole part the number of days, and the fraction the time of day. Two 32bit values. When doing comparisons there is no point converting to a DateTime object, one converts FROM the DateTime to parameter suitable for the database, and leave the database to do the filtering. -- Lester Caine - G8HFL ----------------------------- Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

« previous php.internals (#64298) next »