×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Jan 2009
    Location
    India
    Posts
    138

    Question add and subtract hours in GMT time

    Hi Experts,


    How to add and subtract hours in GMT’s current time.

    Code:
    LOCAL_TIME = strftime("%H:%M:%S %p", time.localtime())
    Output: 12:56:59 PM # india


    Code:
    GMT_TIME = strftime("%H:%M:%S %p +0000", gmtime())
    Output: 07:26:59 AM # Casabalanca

    Now I want to add and subtract in GMT time.
    like (GMT-10:00) Hawaii, (GMT+09:30) Darwin

    like this
    Hawaii Current time = GMT_TIME + (GMT-10:00) Hawaii

    Is there any API for the same; for getting current time of given country/city's time zone.

    Please help me.
    Pavan Pareta
    Sr. Software Engineer
    http://windows-mobile-dev.blogspot.com

  2. #2
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,800

    Re: add and subtract hours in GMT time

    I found this - http://worldtimeengine.com/api/ and something Pythonish - http://pytz.sourceforge.net/
    Last edited by croozeus; 2009-08-04 at 13:43.
    Pankaj Nathani
    www.croozeus.com

  3. #3
    Regular Contributor
    Join Date
    Jan 2009
    Location
    India
    Posts
    138

    Re: add and subtract hours in GMT time

    Quote Originally Posted by croozeus View Post
    I found this - http://worldtimeengine.com/api/ and something Pythonish - http://pytz.sourceforge.net/
    Hi Pankaj,

    Thanks for your reply, but i am not looking any web API,I want to do it using python time API only, still i am looking for good solution.
    Pavan Pareta
    Sr. Software Engineer
    http://windows-mobile-dev.blogspot.com

  4. #4
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,800

    Re: add and subtract hours in GMT time

    Quote Originally Posted by pavan.pareta View Post
    Hi Pankaj,

    Thanks for your reply, but i am not looking any web API,I want to do it using python time API only, still i am looking for good solution.
    The later isn't a web API
    Pankaj Nathani
    www.croozeus.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×