Home  Extras  MODx Add-Ons  DateTime

DateTime



Forums Support Thread 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 | Author: Aramaki

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


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)
  • &timestamp (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` &timestamp=``UpdatesAdded custom time shift




Sub-Packages



Previous Releases


1.02

Forums Support Thread 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 | Author: PaulGregory

Works with the following Version(s):

Outputs time as a string. If no time specified, displays current time. Uses server offset.


Download


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)
  • &timestamp (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? &timestamp=`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.




Comments

Please login to comment.

Close ]


 
 
 

Contact Us | Team Blog | FAQ | Site Credits

© 2005-2009 the MODx CMS project. All rights reserved. Privacy Policy | Terms of Service