-
- 83 Posts
Thanks a lot, that certainly helped.
-
- 3,975 Posts
modxusr, the PDF file in Ditto archive has complete reference to the tags used in Ditto!
-
- 83 Posts
I got the news title right. But,
somehow the news publish-date is displaying as 01-01-1970
I created a snippet with
return strftime("%d-%m-%Y %H:%M:%S", $publ_date);
and called it as [[PublDate]]
Please tell me what I am missing here.
Thanks a lot.
-
- 4,213 Posts
Look for an example at this snippet:
http://modxcms.com/forums/index.php/topic,3588.msg34361.html#msg34361
Please use search and read the docs.
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
-
- 4,213 Posts
Quote from: modxusr at Jun 27, 2006, 01:23 PM
I had tried the snippet with the following part
return $createdon = date('d-M-y h:i:s A',$docInfo['createdon']);
You are not creating the $docInfo variable in that snippet (what is used to get the date from). Try this:
// format for the Date
if(!isset($dateFormat)) {
$dateFormat="%d-%b-%y %H:%M";
}
// Date field to use (ex: createon, editeon, pub_date, etc...)
if(!isset($usedDate)) {
$usedDate='createdon';
}
// Document to get the date from
if(!isset($docId)) {
$docId=$modx->documentIdentifier;
}
$docInfo = $modx->getDocument($docId);
if ($modx->config['etomite_charset']=='UTF-8') {
$createdon = utf8_encode(strftime($dateFormat, $docInfo[$usedDate]));
} else {
$createdon = strftime($dateFormat, $docInfo[$usedDate]);
}
return $createdon;
"He can have a lollipop any time he wants to. That's what it means to be a programmer."