-
MODX Staff
- 730 Posts
I sad to report that updating MySQL did not do the trick. I wonder if there’s a trigger for this behavior. If anyone has any other thoughts, please share! Thanks.
I’ve reinstalled, rolled back, and done just about everything I can think of doing. Does anyone have a clue as to what it might be?
Nothing changes... Ugh. :’(
if there is no other way why do you not format the [+pub_date+] with PHx?
is dateFormat working when you call ditto without the extenders (dateFilter,summary)?
well, currently I am using PHx to format the date, but that still doesn’t solve the problem it’s only a band aid. And while I’ll gladly use the band aid I’d still like to know why it isn’t working. Besides, the reflect snippet is outputting 1969 also and I don’t know of any PHx modifiers that’ll work on that.
Oh, and to answer your question - with or without the extender it does the same.
Thanks.
-
☆ A M B ☆
- 24,524 Posts
Make a php file with this code
$dateFormat = '%B %e, %Y';
$dateUnixTime = 'put the timestamp here';
echo strftime($dateFormat, (intval($dateUnixTime) + <put your server offset from the MODx configuration here>));
and see what happens. (you might need to adjust that server offset business a bit; I’m not sure what value would be returned by the $modx->config["server_offset_time"])
The ditto class function in question is
function formatDate($dateUnixTime, $dateFormat) {
global $modx;
$dt = strftime($dateFormat, (intval($dateUnixTime) + $modx->config["server_offset_time"]));
if ($modx->config["modx_charset"] == "UTF-8") {
$dt = utf8_encode($dt);
}
return $dt;
}