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

Siemens 6SL3120-2TE21-0AA3 Sinamics Double Motor module
$650.0
Siemens 6SL3120-2TE21-0AA3 Sinamics Double Motor module pictureSiemens 6SN1145-1AA01-0AA1 Simodrive 611 Infeed Module Version F
$489.33
Siemens 6SN1145-1AA01-0AA1 Simodrive 611 Infeed Module Version F pictureSiemens 6SC6170-0FC50 Simodrive Power Board
$287.33
Siemens 6SC6170-0FC50 Simodrive Power Board pictureNew LM12CLK Operational Amplifier National Op Amp Guaranteed H56AP
$36.99
New LM12CLK Operational Amplifier National Op Amp Guaranteed H56AP pictureSiemens 6SC6120-0FE00 Simodrive Power Board
$177.33
Siemens 6SC6120-0FE00 Simodrive Power Board picture






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