Results 1 to 3 of 3
  1. #1
    SteveG is offline Member
    Join Date
    Jul 2011
    Posts
    1
    Rep Power
    0

    Default wunderground.com API GMT offset

    Hi, I'm building a bot and trying to implement a weather feature using the API from wunderground.com. I'm able to parse all the data I need successfully from the XML files, my problem is I'm trying to display the time like they're doing on the website, here's an example: 2:04 AM BST on July 12, 2011 (GMT +0100).

    I'm using the local time values from the WXCurrentObXML:
    <local_time>July 14, 10:01 AM PDT</local_time>
    <local_time_rfc822>Tue, 14 July 2009 17:01:17 GMT</local_time_rfc822>

    I've been able to calculate the GMT offset in hours between the 2 dates/times using SimpleDateFormat ect, but I would like to display it like (GMT +0100). Does anyone know how I might go about it?

    Thanks

  2. #2
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,798
    Rep Power
    7

    Default

    If SimpleDateFormat does not provide the format you want then you will have to implement your own formatting. You can either get the format from SDF and append the extra stuff you want or you can fully format it yourself.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,416
    Rep Power
    20

Posting Permissions

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