Page MenuHomePhabricator

Make an API to return system time
Closed, DeclinedPublic

Description

Sometimes tool needs to be in sync with system time of server where mediawiki run. There should be an api that would just return the timestamp of server in some easy-to-parse format so that tools can adjust local system time of machine where they run with time of server where wiki is.


Version: unspecified
Severity: enhancement

Details

Reference
bz63352

Related Objects

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:03 AM
bzimport set Reference to bz63352.
bzimport added a subscriber: Unknown Object (MLST).

maybe it would be better if one of returned values was just offset of central time, so that it's more precise, that way there would be no lag caused by the time that it took for server to deliver the result of api to client

I think you're conflating two issues here. System time doesn't depend on timezone, and timezone doesn't really say anything about the accuracy of system time. And if you're really wanting to synchronize the local system to correct time, you should probably be using something like NTP.[1]

But at any rate, this information has been a part of meta=siteinfo since 2008 (r37034). See the keys 'time', 'timezone', and 'timeoffset'.[2]

[1]: https://en.wikipedia.org/wiki/Network_Time_Protocol
[2]: https://en.wikipedia.org/w/api.php?action=query&meta=siteinfo