Manual:Timestamp

The format of timestamps used in MediaWiki URLs and in some of the MediaWiki database fields is. For example, the timestamp for is. The timezone for these timestamps is UTC.

MediaWiki's function provides a convenient way to convert from timestamps in common formats to the MediaWiki timestamp format and vice versa. Read for more details. Never use when inserting a timestamp into the database; this will break in PostgreSQL and possibly other non-MySQL databases. Instead use, aka  , which converts a timestamp in one of the formats accepted by  to the format used for inserting into timestamp fields in this DBMS.

is a convenience function that returns a MediaWiki timestamp for the present time.

MediaWiki stores timestamps as strings rather than native timestamp types because MySQL's TIMESTAMP type had major limitations when MediaWiki was first written.

Datatypes
Here are the various timestamp datatypes used in the MediaWiki core: