Manual talk:Timestamp
Add topicAppearance
Latest comment: 10 years ago by Leucosticte in topic The format of timestamps is yyyymmddhhmmss??
Is there a way to get the API to provide timestamps in yyyymmddhhmmss format? It's giving them to me in yyyy-mm-ddThh:mm:ssZ format. See for example:
api.php? action=query& list=logevents& letype=newusers& lelimit=5& leprop=ids%7Ctitle%7Ctype%7Cuser%7Cuserid%7Ctimestamp%7Ccomment%7Cdetails%7Ctags& ledir=newer& lestart=2012-09-07T22:16:49ZÂ [try in ApiSandbox]
Well, anyway, I got around it with:
$undesirables = array ( '-', ':', 'T', 'Z' );
$timestamp = str_replace ( $undesirables, '', $timestamp );
Leucosticte (talk) 08:02, 24 September 2012 (UTC)
The format of timestamps is yyyymmddhhmmss??
[edit]From this API call what I get is "2013-11-02T12:07:40Z".--Gqqnb (talk) 13:08, 23 December 2013 (UTC)
- That's different. There, it's been converted into TS_ISO_8601 format by ApiQueryRevisions.php. Leucosticte (talk) 13:19, 23 December 2013 (UTC)