Results 1 to 3 of 3
Thread: wunderground.com API GMT offset
- 07-12-2011, 04:24 AM #1Member
- Join Date
- Jul 2011
- Rep Power
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?
- 07-12-2011, 06:02 AM #2
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.
- 07-13-2011, 09:03 PM #3