This is an auto-generated support/comment thread for
DateTime.
Use this forum to post any comments about this addition or any questions you have regarding its use.
Brief Description:
Outputs time as a string. If no time specified, displays current time. Uses server offset.
Can the date and time be shown like?:
Wed, 26 Feb 1997 08:21:57 GMT
yes, the snippet uses
strftime php function to format the time. So you can check the manual behind that link to see the possible values that can be used in the &format parameter of DateTime snippet.
To get that format would be using something like %a, %d %b %Y %H:%M:%S %z
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
-
MODX Staff
- 12,272 Posts
If it’s not already in there, perhaps it would be helpful to include a link to the appropriate PHP.net manual page for formatting dates in the snippet comments.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
It wasn’t already there when the posts were made, but it is now. I’m going to put more examples into the listing over time. I have a nice list somewhere but I can’t find it.
Funny, I get the date 06.01.1970 ? ? ?
Any Idea where I can adjust this?
Txs!!!!!!
Cheers,
Pieter
Hi,
That sounds like the snippet is getting the wrong input. Are you supplying the timestamp yourself? (What’s the snippet call?)
Is the server-clock set correct?
/Kleist
MODx snippet-glossary 101:
Ditto = Content Lister -- Wayfinder == Menu Builder -- Jot = Comment Control
For some reason, this script pushes the time one hour behind (as where Ditto does it at the correct time).
Any idea why?
-
☆ A M B ☆
- 24,524 Posts
What is the Server offset time setting in your Configuration?