BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 07-31-2009, 07:07 PM   #1 (permalink)
New Member
 
Join Date: Jul 2009
Model: 9530
PIN: N/A
Carrier: Verizon
Posts: 3
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default LocationListener.LocationUpdated() - How to receive timestamp in GMT

Please Login to Remove!

I have written an application using the 4.7 JDE that implements the LocationListener class to receive GPS data. The timestamp that is contained in the Location object contains the time local to the timezone setup on the blackberry. This is not what I want...nor do I want to convert that time to GMT. I need to receive the actual GMT timestamp that is contained in the raw GPS feed. Does anyone know how to do this?
Offline  
Old 07-31-2009, 07:38 PM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

Are you certain about that? This contradicts the documentation and my experience. I believe that the timestampe is UTC time.

How are you determining that this is true? If you are using a date format class, this will format and print the timestamp based on the local timezone. However, the raw integer returned from this function is UTC time.
Offline  
Old 07-31-2009, 09:03 PM   #3 (permalink)
New Member
 
Join Date: Jul 2009
Model: 9530
PIN: N/A
Carrier: Verizon
Posts: 3
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hmmm, that might be my problem. I am using a date format class, but didn't realize it did the timezone correction. I might be mistaken there so I'll review what I have. Thanks for the feedback.
Offline  
Old 07-31-2009, 09:09 PM   #4 (permalink)
New Member
 
Join Date: Jul 2009
Model: 9530
PIN: N/A
Carrier: Verizon
Posts: 3
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

OK, so I see the Date class has a getDate() method that returns the number of ms since Jan 1, 1970 00:00:00 GMT. Is there a simple way to get the date and time components out of that? Thanks for guiding me here, I just am not seeing the mechanisms to do this.
Offline  
Old 07-31-2009, 10:57 PM   #5 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

Use the date to create a Calendar object. Calendar has the methods to retrieve the components of the date/time.

Last edited by Dougsg38p : 07-31-2009 at 10:58 PM. Reason: typo
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.