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

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to