Content-Length: 17074 | pFad | https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/libs/Timestamp/+/master
commit | dde11d6873601231f402c3d03af8b3f101c92ba7 | [log] [tgz] |
---|---|---|
author | libraryupgrader <tools.libraryupgrader@tools.wmflabs.org> | Sat Dec 14 04:42:05 2024 +0000 |
committer | libraryupgrader <tools.libraryupgrader@tools.wmflabs.org> | Sun Dec 15 10:35:46 2024 +0000 |
tree | b5b97fe9edf31e24812cc3aca7b1eba02d229ee1 | |
parent | 0802f99b36a47bab6bae050a8417bc758f596230 [diff] |
build: Updating mediawiki/mediawiki-phan-config to 0.15.0 Change-Id: I352d95de7540d4c386388edc566b523d02329aa5
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.
On input, the following formats are recognized:
TS_MW
, TS_DB
, TS_POSTGRES
, TS_ORACLE
, and TS_EXIF
formats described below.For output, the following conversions are predefined:
TS_DB
: MySQL datetime format: "2012-07-31 19:01:08"TS_EXIF
: Exif 2.2 format: "2012:07:31 19:01:08"TS_ISO_8601
: ISO 8601 expanded format: "2012-07-31T19:01:08Z"TS_ISO_8601_BASIC
: ISO 8601 basic format: "20120731T190108Z"TS_MW
: A 14-digit string: "20120731190108"TS_ORACLE
: A default Oracle timestamp format: "31-07-2012 19:01:08.000000"TS_POSTGRES
: PostgreSQL default timestamptz format: "2012-07-31 19:01:08+00"TS_RFC2822
: RFC 2822 format using an obsolete timezone: "Tue, 31 Jul 2012 19:01:08 GMT"TS_UNIX
: Seconds since the Unix epoch (1970-01-01T00:00:00Z): "1343761268".TS_UNIX_MICRO
: Seconds since the Unix epoch with microseconds: "1343761268.000000".$ts = new ConvertibleTimestamp( '2012-07-31T19:01:08Z' ); $formatted = $ts->getTimestamp( TS_UNIX ); // Shorthand $formatted = ConvertibleTimestamp::convert( TS_UNIX, '2012-07-31T19:01:08Z' ); // Format using PHP date formatting codes $formatted = $ts->format( 'Y-m-d H:i:s O' );
composer install --prefer-dist composer test
Fetched URL: https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/libs/Timestamp/+/master
Alternative Proxies: