MODX time functions: harder than they look
By David Walker (Google profile)
Occasionally you come across something in MODX that is harder than it has any right to be. Take today's date and time. You'd think there'd be a MODX thingumujjig to spit it out. Nope. You'll have to build a snippet. Considering everything MODX does for you, the inability to just summon up a date or time is just odd.
Best solution comes from MODX architect Jason Coward (Opengeek): Create a generalised time snippet (I named mine functionTime) and call it with an output filter applied. Previously I was using a snippet that created the year; this allows you to use the output filter to create any date/time combination.
<?php return time(); ?>
Snippet call in page:
[ [!functionTime:date=`%Y`] ]
And once you have this call, you can display and type of date and time. While finding out the time is unexpectedly hard in MODX, date formatting is easy.