All Questions

1807
votes
29answers
329435 views

Daylight saving time and time zone best practices

I am hoping to make this question and the answers to it the definitive guide to dealing with daylight saving time, in particular for dealing with the actual change overs. If you have anything to add...
69
votes
5answers
87366 views

How to initialize javascript date to a particular timezone

I have date time in a particular timezone as a string and I want to convert this to the local time. But, I don't know how to set the timezone in the Date object. For example, I have Feb 28 2013 7:00 ...
129
votes
2answers
25986 views

Ignoring timezones altogether in Rails and PostgreSQL

I'm dealing with dates and times in Rails and Postgres and running into this issue: The database is in UTC. The user sets a time-zone of choice in the Rails app, but it's only to be used when gettin...
196
votes
14answers
134799 views

How to get a time zone from a location using latitude and longitude coordinates?

There are too many questions on StackOverflow about resolving a time zone from a location. This community wiki is an attempt at consolidating all of the valid responses. Please update my answer, or ...
11
votes
3answers
2242 views

Getting date from [NSDate date] off by a few hours

I am using NSDate *date = [NSDate date]; for getting the date, but the date I get is off by 2 hours.
183
votes
12answers
297530 views

Convert date to another timezone in JavaScript

I am looking for a function to convert date in one timezone to another. It need two parameters, date (in format "2012/04/10 10:10:30 +0000") timezone string ("Asia/Jakarta") The timezone strin...
353
votes
21answers
317817 views

Getting the client's timezone in JavaScript

How can I gather the visitor's time zone information? I need the Timezone, as well as the GMT offset hours.
8
votes
1answers
4283 views

What are the "standard" timezone abbreviations?

I am storing time zone by offset-from-UTC for an application using this dropdown: <select id="timezone" name="timezone" > <option value="-12">[UTC - 12] Baker Island Time</option> &...
517
votes
24answers
147962 views

Determine a User's Timezone

Is there any standard way for a Web Server to be able to determine a user's timezone within a web page? Perhaps from a HTTP header or part of the user-agent string?
5690
votes
8answers
515271 views

Why is subtracting these two times (in 1927) giving a strange result?

If I run the following program, which parses two date strings referencing times 1 second apart and compares them: public static void main(String[] args) throws ParseException { SimpleDateFormat s...

Previous Next