[Mediawiki-api] format of timestamps

Brianna Laugher brianna.laugher at gmail.com
Mon Jul 9 04:35:51 UTC 2007


Hi,

What is the format of timestamps and how can ordinary times be
converted to them?

for example
  lestart        - The timestamp to start enumerating from.
  leend          - The timestamp to end enumerating.

I tried this:
http://en.wikipedia.org/w/api.php?action=query&list=logevents&lestart=200701310001
 attempting "200701310001" to mean "2007-01-31, 00:01"

but the results say
<api>
  <query-continue>
    <logevents lestart="20070709042252" />
  </query-continue>

I had a bit of a look at the api code and found reference to TS_UNIX
and TS_MW, and I had a look at wfTimestamp, but it's all a little bit
too terse for me to figure out what's going on.

I took a guess and used this site
http://www.onlineconversion.com/unix_time.htm to convert my time to a
unix timestamp, and lo & behold, the API worked. :)

So are we supposed to convert their timestamps to unix timestamp
format before they use api.php? Or is there a "human readable" way?

cheers
Brianna

-- 
They've just been waiting in a mountain for the right moment:
http://modernthings.org/



More information about the Mediawiki-api mailing list