Oracle, Propel 1.3 and Dates

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.

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s