Timestamp
Creation, parsing, and conversion of timestamps
 All Classes Files Functions Variables
Timestamp Documentation

![Latest Stable Version] ![License]

Convertible Timestamp for PHP

This library provides a convenient wrapper around DateTime to create, parse, and format timestamps.

Additional documentation about the library can be found on MediaWiki.org.

Usage

$ts = new ConvertibleTimestamp( '2012-07-31T19:01:08Z' );
$formatted = $ts->getTimestamp( TS_UNIX );

// Shorthand
$formatted = ConvertibleTimestamp::convert(
    TS_UNIX, '2012-07-31T19:01:08Z'
);

Running tests

composer install --prefer-dist
composer test