The api returns everything in UTC times, instead of the timezone of the user.
The user however, will always want to be presented with local information... And to avoid confusion, we want to show that in the same zone as the user has configured (not necessarily the same as the browser).
I noticed that currently this is all handled rather adhoc.
- Revision slider mw.libs.revisionSlider.userOffset = mw.user.options.get( 'timecorrection' ) ? mw.user.options.get( 'timecorrection' ).split( '|' )[ 1 ] : mw.config.get( 'extRevisionSliderTimeOffset' );
- Navigation popups gadget fetches all the userthe user option with the api and then caches it in a cookie (because expensive)
- New page patrol, breaks normal API assumptions of return UTC timestamps and modified it's api results to take the user setting into account T45365: PageTriage uses server rather than local time
The proper way to do it right now, is likely to load the user.options module and then fetch 'timecorrection'. However, this module isn't even documented, but worse, it returns implementation details. The value is either in hours, or it's a string like: 'ZoneInfo|-240|America/New_York'
But we should make this consistent and easier to use for everyone.
Maybe add mw.user.getTimeCorrection(), which autoload user.options and parses it or something ?