DateTime
Votes: 13
Tags: snippet, core distribution, date, time
Submitted: Jan 27, 2008
Released: Jan 27, 2008
Downloads: 783
License: Free
Package Website
DateTime 1.03
Works with the following Version(s):
Outputs time as a string. If no time specified, displays current time. Uses server offset and custom time shift (new).
Download
- repo-1840.txt (783 downloads)
Description
Previous version DateTime 1.02
Parameters:
- &format (see http://php.net/strftime) = %d-%m-%Y %H:%M:%S (01-10-2007 15:40:37)
- ×tamp (Unix-timestamp) = now (current time & date )
- &shift (in seconds) = 0 (for +5 days shift use 432000 = 60*60*24*5)
Counts server offset (set in Manager - Administration: System Configuration)automaticaly.
* Original author Alex Butter.
* 1.02 amended 08Aug06 by Paul Gregory, inspired by doze & breezer.
* 1.03 by Aramaki 27 Jan 2008
Instructions
Installation
Create new snippet DateTime and paste txt-file content
Usage
DateTime? &format=`%d.%m.%Y` &shift=`432000` ×tamp=``UpdatesAdded custom time shift
Sub-Packages
Previous Releases
1.02
Votes: 12
Tags: snippet, core distribution, date, time
Submitted: Aug 8, 2006
Released: Aug 8, 2006
Downloads: 1545
License: Other
Package Website
DateTime 1.02
Works with the following Version(s):
Outputs time as a string. If no time specified, displays current time. Uses server offset.
Download
- repo-886.txt (1545 downloads)
Description
Previous version DateTime 1.02
Parameters:
- &format (see http://php.net/strftime) = %d-%m-%Y %H:%M:%S (01-10-2007 15:40:37)
- ×tamp (Unix-timestamp) = now (current time & date )
- &shift (in seconds) = 0 (for +5 days shift use 432000 = 60*60*24*5)
Counts server offset (set in Manager - Administration: System Configuration)automaticaly.
* Original author Alex Butter.
* 1.02 amended 08Aug06 by Paul Gregory, inspired by doze & breezer.
* 1.03 by Aramaki 27 Jan 2008
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.

Please login to comment.