How to set stackoverflow page to local time zone - stack-overflow

Since I have became a user on stack-overflow, I'm having issues with the time stamps on questions and comments. The time stamp is not taking my local time zone. I have looked around in the profile settings and searched for a solution but no luck.
Any idea ?

Email:
Hello,
We do not ever display the time in a local time zone. Every timestamp
on our site always uses UTC time.
Regards, Stack Overflow Team

Related

How to set correct timezone for Google Classroom coursework

When creating a new Coursework via the Classroom API, a "due" date and time can be added (
Classroom API TimeOfDay reference ) and the instructions say that "The date and time zone are either not significant or are specified elsewhere.".
In the context of a class, my expectation was that the number sent would be the number displayed (the teacher generally knows what "11AM" will mean to the class).
However, what actually happens is that the time zone that the server communicating with the API is located in is used to interpret the time. I.e. if the teacher is two time zones away from the backend server, the time will be two hours out.
Is the documentation just wrong? Or is there some way to "specify elsewhere" which I can't find?
This question is a little old, but I just went through some of the same issues, so responding here in case anyone else needs help...
It's not entirely clear how you formatted your create request based on the original question. The TimeOfDay object is used to set dueTime, and as stated in the docs, all dates and times for CourseWork create requests should be converted into UTC: https://developers.google.com/classroom/reference/rest/v1/courses.courseWork
I.e. you need to do any conversions into UTC based on your application/user needs, and the Google Classroom UI automatically converts this date/time into the user's local/date time. Currently there is no other way to do this with this API
Implementing this properly can get tricky depending on how your app/UI is set up, and is further complicated by variations like Daylight Savings Time. For example, if you are using JavaScript, JS dates use UTC internally, the user's browser tracks the current time for that user, and there is currently no other built in functionality for any other timezones. See some of the really excellent explanations about this (and various workarounds) below:
Calculate the UTC offset given a TimeZone string in JavaScript
get timezone offset of another timezone in javascript without using Strings
How to initialize a JavaScript Date to a particular time zone
I hope that's at least a little helpful. It's hard to specifically answer your question about 'what's happening' without more information :)

Representing local timestamps in Ruby based REST API

Perhaps this question should be broken up into two posts, but I currently have an API for a few business customers. I am currently using ISO 8601 timestamps with a UTC time zone to represent times. However, I don't like the idea of these timestamps being attached to any timezone because the times should be the same no matter what timezone you are in. 5PM UTC should be 5PM CST, etc...
I know that you can leave the Z off of an ISO timestamp, and it will be interpreted as whatever local time you are in. Is this ok practice? And if so, how do I do this in Ruby? I read the doc for the Time class and didn't see anything about this.
EDIT: Let me re-word this just a little bit, or atleast clarify something. The reason why I'm seeking timestamps that aren't attached to a timezone is exactly because I know that my client servers and API server will hardly ever match up. If a client is submitting an event with a time, that time needs to be ambiguously equal to the ambiguous locale specific to the event that the user is working on.
That's a mouthful...assume that I'm working on an event scheduler. Each event belongs to a storefront or location of a company. When times are being shown for a location, it is assumed that the times shown are in the timezone of the location, and for clarity's sake should never be shown at a time formatted to a user's local timezone. If I'm looking at the scheduler on the East Coast, but looking at events for locations on the West Coast, the times I should see should be local to the locations on the West Coast, not adjusted for my timezone.
I know a solution could be to simply store times with timezone information for the location its associated to. But the use case that a user would want to convert a time to their timezone is VERY rare, and I'd rather make implementing my API easier...this was actually my original implementation but implementing the API in many different environments and across multiple programming languages, it became clear that it is a hurdle to show times local to that timestamp's timezone for a lot of languages. If a user wanted to convert times to their local timezone I could easily store global timezone information for the location object itself.
I don't know what you mean by "the times should be the same no matter what timezone you are in. 5PM UTC should be 5PM CST, etc..". 5PM UTC clearly isn't 5PM CST!
Anyway, I don't think that what you are proposing is an ok practice. Suppose you leave off the Z and have a timestamp be interpreted as whatever local time you are in. Since this is a network API, the client and server might not be in the same timezone. When the client submits a "local" time, what does it mean? The local time on the client (if so, how does the server know what that is?)? The local time on the server? It's ambiguous. This is the crux of the reason why just about the only reasonable thing to do is to use UTC throughout.
What you can do is attach a timezone to a timestamp if it might be relevant. For example, "you should observe one minute of silence at 2012-11-10T22:00:00Z in honour of the soldiers who died in WW1" sounds weird because Rememberance Day isn't on November 10! "you should observe one minute of silence at 2012-11-11T11:00:00+13:00" sounds a lot better once you put that New Zealand time zone in there... In this case you can keep and timestamp (in either local or UTC) together with the timezone offset (e.g. store both of them together in your database).
It does, however, depend on what your times represent. For example, in "at equinoxes, sunset happens at 18:00" it makes sense to use an abstract time that isn't qualified with a timezone (it's true in every timezone, and/or you're talking about solar time). But attaching a date to this abstract time makes little sense, so I don't think you would be talking about ISO8601 in this case.

Windows Phone 7 - I want to get daylight savings offset via programming

I want to have one feature in my windows phone application where i will require to see if for the time zone whether the daylight settings is currently on or off.
I can get this detail for the time zone which is set in my phone, but what i want is that i can get this for any time zone i pass or set.
For example, if i pass time zone "Antarctica/Palmer", i should able to find whether currently daylight setting is on or off. I tried few things but not able to find anything. I do
not want to use any web api to give me this.
Is there any facility where i can set the timezone via code to get the result and then revert it back to original or some other solution?
Thanks.
There's the IsDaylightSavingTime method:
Indicates whether a specified date and time falls in the range of daylight saving time for the time zone of the current TimeZoneInfo object.
It requires you to have a TimeZoneInfo object, but you indicate that you already have that.
For example, if i pass time zone "Antarctica/Palmer", i should able to find whether currently daylight setting is on or off.
That looks like a zoneinfo/tzdb/Olsen time zone ID to me, not one that Windows in general uses. My Noda Time project uses tzdb and would be able to get you that information, but we don't currently build a Silverlight version - we probably could with a bit of work, but it wouldn't be trivial. Patches would be welcome, of course...
Do you definitely want to use tzdb IDs, or would the appropriate Windows ID be okay for you? Unfortunately TimeZoneInfo.FindSystemTimeZoneById appears not to be supported on Silverlight :(

How to enter time at DST changeover?

I'm working on an app that will be used by the public services (ambulance). Since those people work around the clock, they will realistically need to enter date/time values at ANY time of the day. Which also includes DST changeover times.
Now, when entering the time at the "short" day, things are easy. Simply any value between 3:00:00 and 3:59:59 is invalid. Problem is with the "long" day, where values in that same interval are ambiguous.
Is there any standard way/notation for entering time at that dreadful hour? Have you ever used any other workarounds, and which ones did your users find good?
Added: Also cloned on ux.stackexchange.
Allow the user to enter the localised time (i.e. whatever their PC clock is displaying) but save it in UTC. When you display them remember to use a localised time method and it will fix itself, see this SO Question for more details: How to display localized date and time information to web users with ASP.NET

custom time zone

Is thee some way of implementing a custom time zone in windows?
We have some PCs in Creston, British Columbia, Canada (Time zone exception) which stays the same time all year. So essentially, Creston does not observe a time zone. Can I implement this behavior in windowsÉ
I wrote a lengthy blog post about a similar problem we had: http://subjectivecoder.blogspot.com.au/2013/04/creating-custom-windows-timezones.html
The short version is that there is a spot in the registry which allows you to modify or create new time zones - but the registry format is fairly nasty.
Microsoft has a GUI tool called TZEdit which you can find here: http://support.microsoft.com/kb/914387 (scroll down to Method 2 and download TZEdit.exe).
If you want to see what's going on behind the scenes, I've published the source to the command line tool I built here: https://github.com/Rophuine/TimeZoneInfoGenerator (it's untested and quick-and-dirty but may help you understand what's going on, if you're interested).
Apart from daylight savings time, this is normal MST (UTC-0700), right?
Windows used to have a checkbox called something like "Automatically adjust the clock for daylight savings time". Maybe you can hunt that down. Even if there is no checkbox, chances are that the registry setting still exists.
The data is in: HKLM\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Time zones.
You can probably add your own zone.
Each zone has its own key. And they contain a lot of data. Some zones have a subkey Dynamic DST.
This is not exactly an answer, but you might consider trying to get Creston recognized as an official time zone. As for how exactly to do that... contact Microsoft, I guess, and ask where they get their time zone info from. Probably the closest thing to an official time zone database in computer programming is zoneinfo but I'm not sure if Microsoft uses it.
WARNING: You should be very careful about creating your own time zone, even if you think your systems are isolated.
This could cause problems with exchanging information with other systems, both from conversion errors as well as exception handling.
If the time zone you want is legally recognized, you should consider bothering your vendor to properly add you to the time zone repository they use.

Resources