DateTime 1.02
Outputs time as a string. If no time specified, displays current time. Uses server offset.
Submitted: Aug 8th 2006 | License: None Specified | Downloads: 1404
Description
This is DateTime from the standard install, with two changes:
1) This now uses the server offset (set in Manager - Administration: System Configuration) to display the correct time.
2) You can now over-ride the default time format with one that is more pleasing to you.
The DateTime snippet was written by Alex Butter and first appeared in phase06_rc1 back in August 2004.
Instructions
Copy the contents of the text file into a snippet called DateTime. You may already have one with that name. The basic functionality has not changed so you are probably safe switching them. However, if you don't want the two extra features, you may as well stay as you are.
Basic usage:
[!DateTime!]
Will output the current time, eg 08-08-2006 19:15:33
[!DateTime? ×tamp=`123`!]
Will output the time of the timestamp. I need to improve this example.
[!DateTime? &format=`%d/%m/%Y %H:%M`!]
Will output the current time in the format you've specified.
Some format examples:
&format=`%d/%m/%Y %H:%M` - 14/08/2006 19:15
For more on the format, you can read the
strftime conversion specifiers at the PHP site.