In the current template I use the top of each page shows the current date & time using snippet DateTime. Instead of the actual date & time, I would like to show the published date/time or the edited date / time. So I created a new snippet called UpDateTime that has the following code (and of course, this snippet is called instead of the DateTime snippet in the Default Template code):
if($pub_date > 0 ) {
$timestamp = $pub_date ;
} else {
$timestamp = $editedon ;
}
return strftime("%d-%m-%Y %H:%M:%S", $timestamp);
Unfortunately, this always returns "0" (or actually: Jan 1st 1970, 00:00 )
Q: how can I do this the right way?
You could also check out the
PHx Plugin
PHx (Placeholders Xtended) will add the capability of output modifiers when using placeholders, template variables and settings tags. It also supports nested tags.
.: COO - Commerce Guys - Community Driven Innovation :.
MODx est l'outil id
thnx a million!
that really helped
(and I understand the modx variables a lot better now!)