views:

60

answers:

3

Does anyone provide an 3rd party API that does time zone conversions? I'm thinking of doing it for a site, just to make it easier to handle all the intricacies. It is a multi-zone scheduling kind of applicaiton and time zones need to be handled perfectly.

I dont think timeanddate.com does it, but does anyone else? Reliabily?

+1  A: 

I found a few just searching on google, such as this one:

http://worldtimeengine.com/api/instructions

There seem to be some for a variety of languages, it depends on your need I guess as I'm not sure if you are trying to do it based on city or what

Rick
good url but pain thing is it's not free :)
srinivas
paid options are fine, but we're looking for a _simpler_ timezone converting service... and which is reliable / running for some time...
tzmatt7447
Thanks Rick....
tzmatt7447
A: 

I really want a simple function where I give it a certain time and date (in a timezone) and tell it what timezone I want it in - and it should give me the exact date and time in the target zone! Yes of course this is possible internally, but I fear getting it wrong!

Then you need to test, test and test more. If you're outsourcing because you're afraid of programming you should just buy some software. ;P

The function itself is simple enough.

http://php.net/manual/en/datetime.settimezone.php

function convertTimeZone($time, $origin, $target) {
    $date = new DateTime($time, new DateTimeZone($origin));
    $date->setTimezone(new DateTimeZone($target));
    return $date->format('Y-m-d H:i:s');
}

echo convertTimeZone('2000-01-01 00:00:00', 'Pacific/Nauru', 'Pacific/Chatham');
deceze
A: 

Something I made a while ago gives you all timezones, their current time, and if DST is active there or not:

http://api.coronatus.com/clock/read

You can use the utc_offset field to do timezone conversions.

Coronatus