Tuesday, November 6, 2007

Date/Time related Meta-level methods

I had written two new Openspace Meta class methods today. sf_getUnixTimestamp($id,$att,$iatt,$obj) returns the total seconds of a given object value since epoc. The second one (which rides on the prior function) sf_getZendDate($id,$att,$iatt,$obj) returns a ZendDate object. How are these function useful? The first is to do a DB query of a timestamp datatype without having to convert the resulting value into some readable format. ZF docs say this is the fastest means of getting data out of a database, using it to create a Zend_Date object. That is of course, what the second function does. Bottom line, Openspace developers now have a easy way to create Zend_Date objects, and this in turn, makes date and time manipulation so much more easier. Weeehoooooo!