timezone

How do you get info for an arbitrary time zone in Windows?

Ideally, what I'd like to be able to do is take the name of a time zone and ask Windows for its corresponding time zone info (offset from UTC, DST offset, dates for DST switch, etc.). It looks like Windows uses a TIME_ZONE_INFORMATION struct to hold this sort of info. So, presumably, I want a function which takes a string with the time z...

Linux: how to set up a timezone of a process?

Hi I'd need to set timezones of individual processes started on a linux box. I tried setting TZ variable (in the local context), but it didn't work. Is there a way of running an app from a command line with a different system date to the system one? It might sound stupid, but I need a kind of a sandbox where the system date would be cha...

Simpledateformat parse issue

I'm parsing a date which is in format EEE, dd MMM yyyy HH:mm:ss Z. One of the sample values is Thu, 02 Sep 2010 04:03:10 -0700. This is the parsing code: SimpleDateFormat FORMATTER = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss Z"); Date date = FORMATTER.parse(dateString); This works absolutely fine if Phone Language is English bu...

VB.Net...Getting the DST value in another timezone

In a followup to another question I posted. I know it is possible to get a value indicating if the current system timezone is in daylight savings time. However, is it possible to specify some other timezone and determine if that timezone is in DST? ...

How to get the data to populate time zone switcher widget on website?

The task: Time zone chooser widget that allows site visitors to choose their time zone should be generated and populated with reasonable data. It should offer choices like this: GMT-11 (HH:MM actual time in that zone) GMT-10 (...) GMT-1 (...) ... now for the tricky part: GMT (...) GMT+1 (...) ... and then all the way until +12. When ...

Hibernate date conversion

I have a wierd hibernate related issue while setting a date field in an entity. The date is interpreted as UTC in the java program (i did a System.out to make sure the date assigned is in 'UTC'. However, when hibernate actually persists to the database, the date is converted to local time and stored) ex. the value has been set in the ent...

Ruby can only show local time and Greenwich Mean Time (UTC) but not East Coast Time or Central Time?

$ irb ruby-1.9.2-p0 > RUBY_DESCRIPTION => "ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0]" ruby-1.9.2-p0 > Time.now => 2010-09-07 18:18:38 -0700 ruby-1.9.2-p0 > Time.now.gmtime => 2010-09-08 01:18:43 UTC ruby-1.9.2-p0 > Time.now.strftime('%H:%M %Z') => "18:22 PDT" ruby-1.9.2-p0 > Time.now.gmtime.strftime('%H:%...

What is the time difference between Pacific region and Atlantic region?

What is the time difference between Pacific region and Atlantic region? I found answer in http://wiki.answers.com site, and It says 3 hour means AST is 3 hour behind from PST. Update: I want the correct off set between EST (Eastern time zone) and AST (Atlantic time zone). I just want to confirm it. Thanks.. ...

Formatting Dates and DateTimes for User's timezone including Timezone Offset in C# (.net)

I am working on a C# application and want to display dates so they are local to the user's timezone. We have the user's timezone setting stored in the database, and all dates are stored in the database in UTC which should make this simple. The trick is that I also need to display the timezone offset for each date localized for the user.....

How do you get info for an arbitrary time zone in Linux / posix?

Ideally, what I'd like to be able to do is take the name of a time zone and call a function to ask for its corresponding time zone info (offset from UTC, DST offset, dates for DST switch, etc.) in Linux. However, I can't find any way to do this. The information exists in /usr/share/zoneinfo/ in the various binary files there, but I don't...

Daylight Savings Time not calculated properly in Rails 2.3.5?

Hello, I have a very strange issue with Daylight Savings Time (DST) in my app. For some reason, whenever I receive a time from the table, it doesn't adjust itself for DST. For example, if I create a new Time in the console, in the appropriate time zone, write it to the database, and then try to retrieve it from the database, it comes ba...

Flex Date issue with Timezone

Hi All We have a search utility that needs to search by date: So I type in a date "04-20-1982" in the search field. In the code: Alert.show("string date::"+message.searchKeyword); dateOfBirth = DateField.stringToDate(message.searchKeyword,"MM-DD-YYYY"); Alert.show("date::"+dateOfBirth); The first alert prints as string date::04-20...

rails calendar select with time zone?

My client wants to have a calendar picker with support for time zones. Right now they are using the venerable calendar_date_select picker http://code.google.com/p/calendardateselect/ Which has no support for time zones. Surprisingly, I can't find any other plugins or other help in handling this. I would think this was a common probl...

Using NSDateFormatter to format date to local date

I have tried numerous attemps of formatting a relatively simple date format to a date object, but also converting to my local time zone. All dates are formatte like this: 2010-09-11T08:55:00. This is GMT time, and I want it converted to a date object with GMT+2. Can anyone please point me in the right direction? ...

Java timezone conversion

I have a String, representing time in UTC. I need to convert it to long representing milliseconds since midnight at EST, considering daylight saving times. For example, in January, the offset is 5 hours, but in June 4 hours. However, the code below displays the same offset of 5 hours for both June and January. The variable tzOffset = -1...

UI design: display events in different timezones on same calendar

I'd like to show events on a calendar for my web service's customers. There are four scenarios possible in regards to timezones for these events: An event is local to the customer and is in the same timezone. For example, a meeting with a local business. An event is physically located in a different timezone than the customer, but it i...

Populate mysql timezone info from mysql data set, not from system without restart

I'd like to populate the mysql timezone tables with the database provided by mysql. I am using a cloud DB and can't overwrite DB tables and restart the server. Can someone help me understand how to load these files manually? Rational: I loaded the tz tables from the OS, but the OS has a ton of timezone names. I'd like a more concise set...

Need help in Timezone in Rails ActiveRecord

Hi, I am faced with a peculiar issue with respect to Timezone in Ruby. I want to convert the following Sat Sep 11 15:15:00 +0530 2010 to Sat Sep 11 15:15:00 -0400 2010 As you can notice, only the time zone has been converted and no other part has changed. How to do this in Ruby. ...

C++ library for time zone handling

I'm looking for a simple C++ library that allows me to convert timezone descriptions like "America/New_York" into an offset to GMT. I'm looking for a lightweight library to add to an existing project. ...

Given a date in UTC time, how do I know if it's currently the same day anywhere else in the world?

Suppose I have a particular UTC time T. I would like a method that returns true if it is possible that at least one spot somewhere else on Earth has the same local date as T right now. def still_same_date?(t) # true # if it is the same day at some other place on Earth # false # otherwise end For example, let's say T is tod...