Consciousness

Oracle, Propel 1.3 and Dates

Posted in Oracle, Programming by Personalife on the May 6th, 2008

It took me awhile to figure out how to parse an Oracle date type with Propel 1.3. The easiest way to do it would be this:

define(“DATE_FORMAT”, ‘M j, Y g:i a’);

< ?=date(DATE_FORMAT, $event->getStartDate(null)->format(“U”));?>

Assume there is an Event that stores the date and time of when the event begins. The code above basically translates the Oracle date to UNIX time, where you can then use the PHP date function to parse it out.

No Comments »

No comments yet.

RSS feed for comments on this post. | TrackBack URI

Leave a comment

XHTML ( You can use these tags): <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .

Powered by WordPress .::. Designed by SiteGround Web Hosting