timezone

Web service for Timezone based on Location

Hi, Is there any web service available that returns the information of Time zone based on the location name entered. I am preparing the application where in user will enter the place, based on the place entered, I need the information of the timezone (preferably current time and date) of that particular location. Kindly help me. Rega...

SimpleDateFormat give inconsistent results

I am trying to parse a date and I am getting different results when I run the code locally/BST compare to a server in Paris/CEST. I've reproduced the issue in a the following sample. This is trying to parse the start date for the Australian Grand Prix. TimeZone tz = TimeZone.getTimeZone("AET"); DateFormat dateFormat = new Simp...

Timezone calculation

How to find out the current time in different timezone in xcode for an iphone application? Suppose i'm in India and i want to know the current time in USA how do i get the time then. Thanks in advance Joy ...

Changing the system time zone succeeds once and then no longer changes

I'm using the WinAPI to set the time zone on a Windows XP SP3 box. I'm reading the time zone information from the HKLM\Software\Microsoft\WindowsNT\Time Zones\<time zone name> key and then setting the time zone to the specified time zone. I enumerate the keys under the Time Zones key, grab the TZI value and stuff it into a TIME_ZONE_IN...

How to get a different Timezone in .net with code

hi there There must be a simple way to get different timezones with code (ie without changeing your system timezone) So far you can do something like var timezone = TimeZone.CurrentTimeZone; but I cant see any other way to get a different timezone? or should I just use TimeSpan? Actually it seems like it s a better idea to use Tim...

How to store and compare time-zone sensitive times

I have a data structure where an entity has times stored as an int (minutes into the day) for fast comparison. The entity also has a Foreign Key reference back to a TimeZone table which contains the .NET CLR ID Name and it's Standard Time/Daylight Time acronyms. Since this information is stored as time-zone insensitive - I was wonderin...

Changing timezone in MSYS

Hello, how can I change timezone on MSYS+MinGW for Windows if I have only "date" command installed? There are no "tzconfig" or "tzselect" here. When I try $date --set="Apr 01 23:08 UTC+04:00" I receive 19:08 GMT+0 result. This is very important for me because "make" command always gives me errors about files modified in future. ...

Russian time zone changes

As many of you know, Russia has eleven time zones, and has (or will) cut two of them. It is possible that they may end daylight savings time altogether. Does anyone know if they have cut two time zones, and if daylight savings is now a thing of the past? If so, does daylight savings end in all time zones, or just some? I maintain some ...

Storing date/times as UTC in database

I am storing date/times in the database as UTC and computing them inside my application back to local time based on the specific timezone. Say for example I have the following date/time: 01/04/2010 00:00 Say it is for a country e.g. UK which observes DST (Daylight Savings Time) and at this particular time we are in daylight savings. Wh...

simpledateformat parsing date with 'Z' literal

I am trying to parse a date that looks like this: 2010-04-05T17:16:00Z This is a valid date per http://www.ietf.org/rfc/rfc3339.txt. The 'Z' literal "imply that UTC is the preferred reference point for the specified time." If I try to parse it using SimpleDateFormat and this pattern: yyyy-MM-dd'T'HH:mm:ss It will be parsed as a...

How to convert "9:00 PM EST" to a Date object

I am developing an Android application and require some basic datetime manipulation. I have a Date object (from Java.util.Date) holding a specific date. I need to add a specific time to it. The time I have is a string in this format: "9:00 PM EST" How would I "add" this time to the previous date? If the Date object currently has: "4/24/...

.NET get timezone by city or by longitude and latitude

Hello, I'm using .NET and I'm able to geolocate user city by IP. Is there easy way to get user timezone by long. and lat. or city name? I wonder how facebook is doing it? Thank You ...

Can I Force A ASP.Net Website to Show Time in A Specific Time Zone?

I have a client request that all times be displayed in Pacific Time Zone, regardless of client settings. I'd like to avoid a scenario where I have to call a function for every time display and instead have a single point where I can make the switch. I'm thinking a custom culture might do the trick, but I wanted to ask before I set off d...

How do I.. get a value for time at 9:00am local, regardless of the timezone?

In my app, I need to set a variable for a start time to be 9:00 a.m. local, wherever the user is located. I have a timezone variable for each user and the save and retrieve are all working. But I need to set a variable when I create a new event to be 9:00 am in the user's local time zone. My current method uses the local time of the s...

Converting a user inputed time and date to GMT time

This is probably a simple answer. I searched but couldn't find what I was looking for... If someone in the GMT + 10 time zone inputs a date (e.g: 2010-08-01 23:09:33) which I then convert to a TIMESTAMP (strtotime()), how do I convert that to GMT time? ...

PHP Default Timezone issue on Fedora + Zend Server CE

I have ZendServer CE (PHP 5.2) installed on a Fedora VM, and I have the system timezone set to 'America/Chicago'. I have date.timezone = 'UTC' in my php.ini file, and when I call date_default_timezone_get(), or display date('T') on a web page, it says 'CDT'. The documentation on php.net for date_default_timezone_get() says it follows th...

Converting local timestamp to UTC timestamp in Java.

I have a milliseconds-since-local-epoch timestamp that I'd like to convert into a milliseconds-since-UTC-epoch timestamp. From a quick glance through the docs it looks like something like this would work: int offset = TimeZone.getDefault().getRawOffset(); long newTime = oldTime - offset; Is there a better way to do this? ...

How can a Windows program temporarily change its time zone?

I've written a function to return the time_t value corresponding to midnight on a given day. When there is no midnight for a given day, it returns the earliest time available; that situation can occur, for example, when Egypt enters daylight-saving time. This year, the time change takes effect at midnight on the night of April 29, so the...

best practice to obtain time zone for iPhone vs iPod Touch

I am creating an app that requires the users current time zone. If the device being used is an iPhone and the user has their Time Zone set to automatically change, I think I can be fairly confident that localTimeZone or systemTimezone will give me the correct time zone for the user's location. If on the other hand the device is an iPod ...

Simplest way to get current time in current timezone using boost::date_time ?

If I do date +%H-%M-%S on the commandline (Debian/Lenny), I get a user-friendly (not UTC, not DST-less, the time a normal person has on their wristwatch) time printed. What's the simplest way to obtain the same thing with boost::date_time ? If I do this: std::ostringstream msg; boost::local_time::local_date_time t = boost::local_t...