Forum:Local time in template

Our wiki has a template that has a parameter    where, if one sets it as     a timestamp will be included in a particular part of the template when it is rendered. Because the user’s signature will provide the timestamp in UTC, I thought it might be nice to have the timestamp rendered by the template in the user’s own time zone. Only, I cannot figure out how to do it. I’ve experiented with various time functions found at mw:Help:Magic words and m:Help:Magic word, but they seem to also use UTC. Perhaps a parser function for time might work, but I’m not sure. Any ideas? Thanks! — Spike Toronto  13:34, August 10, 2011 (UTC)


 * Well, I don't know how to stamp the local time for each user, but if you know the timezone you can set it with ( which produce  (UTC+2)) while  is the UTC time ( (UTC)). I used the parser functions for time. The problem is this way you have to set the timezone (maybe with a parameter). There are also the local time magic words but they gives the local time of the server. I don't have any other ideas right now. Maybe if there is a magic words to retrieve the time zone of the user' settings, you can use it for setting the time zone.


 * If timestamps are in different time zones, doesn't that defeat the point of a timestamp. Users would have to work out the offset if they see different people post with different zones --  Random Time  16:28, August 10, 2011 (UTC)


 * Some of us don't like converting the time if we don't happen to live in England. :-P -- Fandyllic (talk &middot; contr) 10 Aug 2011 4:19 PM Pacific


 * That may be true (I have to take an hour off, too) but if you're reading a thread, it's hard if other people are posting in other time zones to get a sense of what happened when, especially if the replies aren't in sequence. --  Random Time  23:24, August 10, 2011 (UTC)

 Leviathan : You’ve discovered what prompted me to post this query! The local time is actually the server’s local time, also stated in UTC.  RandomTime : With few exceptions, almost every user’s signature renders the time in UTC. What I wanted was for the timestamp in the template — which is additional to, not a replacement for, the timestamp in the signature — to render that timestamp in the viewer’s local time. That way, s/he would see the time stated for them both locally and in UTC. The idea was not to take anything way, but to add.""This would not be an issue if our Preferences permitted an option like the Change UTC-based times and dates, such as those used in signatures, to be relative to local time gadget at Wikipedia. You create a signature like normal, without any timecode. Then, when you type four tildes (i.e., ~ ), the system adds to your signature a timestamp. In other words, the normal, default way of doing things. The raw timestamp (i.e., how it appears in Source mode) is stated in UTC. But, wherever you look at the processed, rendered code (i.e., talkpages, user talkpages, page histories, noticeboards, recent changes, etc.), it appears translated into the viewer’s own time zone. Thus, for me, Leviathan’s timestamp, RandomTime’s timestamp, and my timestamp, would all appear — to me — in Eastern Daylight Time. Perhaps we should petition Wikia to add this gadget to wikis that request it. (To see what I mean, go to your Wikipedia preferences, if you have an account there, tick the appropriate box, save the new setting, then browse around the site and see how every timestamp is expressed in terms of your time zone.)""In the meantime, I would still like the template’s timestamp — as opposed to the signature’s — to render the time in the viewer’s local time. Thanks for the comments. Er … umm … any template coding ideas? Thanks! — Spike Toronto  01:50, August 11, 2011 (UTC)