World Time Engine > What time is it?  |  Current UTC/GMT Time:   3:14 AM on Wednesday, July 9, 2008
 




Guide to using the World Time Engine Local Time API™

Quick Index




 

Sending a Request to the Local Time API

Local Time is delivered in Extensible Markup Language (XML) Format in response to a standard HTTP GET request.

To access the service, you will need to order an API key. Once you have your key you will be able to send requests to the following URL:

http://worldtimeengine.com/api/<apikey>/<latitude>/<longitude>
where apikey is your unique api key, and where latitude and longitude should be replaced with the latitude and longitude of the place to query.

Here's an example for Windhoek, Namibia:

http://worldtimeengine.com/api/9d89405104e16732fa00caa1e8e6cdfd/-22.5749/17.0805

 

Receiving a Response from the Local Time API

On sending a request as per the instructions above, you will receive a response from WorldTimeEngine.com. Depending on the validity of the API Key used in the request you will either receive a timezone response or an error response.


TIMEZONE: API Key Valid

If the API Key that you used to send your request validates successfully on the server, you will receive a timezone response, like:

<?xml version="1.0" encoding="UTF-8" ?>
<timezone xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:noNamespaceSchemaLocation="http://worldtimeengine.com/timezone.xsd">
    <version>1.1</version>
    <location>
        <region>Namibia</region>
        <latitude>-22.5749</latitude>
        <longitude>17.0805</longitude>
    </location>
    <time>
        <utc>2008-02-16 08:31:01</utc>
        <local>2008-02-16 10:31:01</local>
        <zone>
            <hasDST>true</hasDST>
            <current>
                <abbreviation>WAST</abbreviation>
                <description>West Africa Summer Time</description>
                <utcoffset>+2:00</utcoffset>
                <isdst>true</isdst>
                <effectiveUntil>2008-04-05 18:00:00</effectiveUntil>
            </current>
            <next>
                <abbreviation>WAT</abbreviation>
                <description>West Africa Time</description>
                <utcoffset>+1:00</utcoffset>
                <isdst>false</isdst>
                <effectiveUntil>2008-09-06 18:00:00</effectiveUntil>
            </next>
        </zone>
    </time>
</timezone>

The values returned in this type of response are detailed below:

ERROR: API Key Invalid or Expired

If the API Key that you used to send your request does not validate successfully on the server, you will receive an error response, like:

<?xml version="1.0" encoding="UTF-8" ?>
<error xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:noNamespaceSchemaLocation="http://worldtimeengine.com/error.xsd" type="exception">
    <code>10001</code>
    <message>Invalid or Expired API Key used</message>
</error>

The values returned in this type of response are detailed below: In the case of an error response, you should check that the API key you are using is identical to the one provided when you signed up to the service and that this API key is still valid (12-months since the start of your subscription). This will ensure that you can receive timezone responses successfully.
 

Further Assistance

If you require further support or assistance please contact us and we will be happy to help.





W3C XHTML Compliancy     W3C CSS Compliancy

Copyright © 2008 World Time Engine. All Rights Reserved.