views:

29

answers:

2

I'm try to ascertain an event time from a date template variable in a modx snippet. However that template variable has a date formatter widget in it which, while nicely formatting the date, doesn't output the time of the event.

I know that modx stores dates in unixtime in it's database, is there an easy way to directly access the unixtime of the event? I'm currently using $modx->getTemplateVarOutput() calls.

Thanks for your help

A: 

If you look at the default format for the Data Formatter widget you'll see it's set at:

%A %d, %B %Y

Using the info here you would need a format similar to %A %d, %B %Y %R if you wanted to include time.

Fishcake
That would be the ideal but other part of the site rely of it being in it's current form
PhilI
A: 

It turns out if you use $modx->getTemplateVars() instead then that allows access to the underlying unixtime in the 'value' element in each element.

PhilI