Extension:Strtotime

Purpose
This extension allows to represent time as a string containing a US English date format.

Note: Same functionality can be achieved using #time from  Extension.

Usage
where:
 * 'time transformation' is the string containing time transformation applied to the base date to calculate the target date
 * 'year' is the base year to calculate the target date
 * 'month' is the base month to calculate the target date
 * 'day' is the base day to calculate the target date
 * 'format' is the string containing the target date output format

Installation

 * 1) Copy source code into a file called $IP/extensions/Strtotime/Strtotime.php
 * 2) Enable the extension by adding this line to LocalSettings.php: require_once("$IP/extensions/Strtotime/Strtotime.php");

Examples
Output: 2000-01-02

Output: 2000-01-02

Output: 1999-12-31

Output: Sunday 19th April 1981

Output: 06 Jan 2000 (Thursday)

Output: 27 Dec 1999 (Monday)

If not otherwise specified the target date time will be 00:00:00. Output: 2000-01-02T04:32:00-08:00

If the transformation time is a date the output will be such date Output: May 28, 1976

The word 'now' refers to the base date and not to the current date. Output: 2000-01-01

When the base day exceeds the number of days of a the base month, the offset days will be interpreted as days of the next month. Output: March 06, 1979

Syntax errors in the time transformation will generated undetermined outputs. Output: Jan/02/2000

Check PHP's | date function for complete description of date formats.

Check PHP's | datetime formats for complete description of available time transformations.