BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 07-17-2009, 12:09 PM   #1 (permalink)
New Member
 
Join Date: Jul 2009
Model: 9530
PIN: N/A
Carrier: Verizon
Posts: 10
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Get the local network time

Please Login to Remove!

I'm trying to retrieve the local network time. In other words if I set my Blackberry time zone to PST (GMT-8) and I'm connected to a network in the eastern time zone (GMT-5) I would think that network time I retrieved would be GMT-5. It is not. The network time is displaying as PST (GMT-8). I am using the following code:

long lNetworkMilliseconds = RadioInfo.getNetworkTime(System.currentTimeMillis( ));
DateField NetworkTime = new DateField("Network Time:", lNetworkMilliseconds, DateField.TIME);

Am I doing something incorrectly? Any advice would be greatly appreciated.
Offline  
Old 07-17-2009, 01:59 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

My understanding of this is that it returns the network time (in UTC) adjusted for the local timezone.

In my experience, this means the local time zone set in user preferences, which is what you are seeing here.

We were looking at this once to see if we could set the timezone programmatically as the holder travels through timezones, but it didn't pan out.

I'd love to hear someone else ring in on this issue.
Offline  
Old 07-17-2009, 03:06 PM   #3 (permalink)
New Member
 
Join Date: Jul 2009
Model: 9530
PIN: N/A
Carrier: Verizon
Posts: 10
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the reply, Doug. Unfortunately you're confirming what I had suspected. The network time displays on my BB but I guess the API does not give us exposure to this bit of info.

-Tony
Offline  
Old 07-18-2009, 07:33 AM   #4 (permalink)
New Member
 
Join Date: Jul 2009
Model: 9530
PIN: N/A
Carrier: UPS
Posts: 3
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I Think it will be good try to useany webserivse for what task.
Regards Tigran
Offline  
Old 07-18-2009, 07:57 AM   #5 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

If you can get the device location (from GPS or OpenCellId) you could use Earth Tools to get the time zone information. Not perfect but they seem to have done the heavy lifting.
__________________
My other Blackberry is a PlayBook.
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

MSA 10074137 ALTAIR PRO Single Gas Detector, Oxygen (O2)
$99.95
 MSA 10074137 ALTAIR PRO Single Gas Detector, Oxygen (O2)  picture(1PCS) ALTAIR04-900TR IC OFFLINE SWITCH PWM 16SOIC ALTAIR04 04-900
$2.13
(1PCS) ALTAIR04-900TR IC OFFLINE SWITCH PWM 16SOIC ALTAIR04 04-900 picture(5PCS) ALTAIR05T-800TR IC PRIMARY SWITCHING REG 16NSOIC ALTAIR05 05T
$9.29
(5PCS) ALTAIR05T-800TR IC PRIMARY SWITCHING REG 16NSOIC ALTAIR05 05T pictureMsa H2s Altair Pro Monitor
$11.99
Msa H2s Altair Pro Monitor pictureMSA Altair H2S Gas Detector 33 Months Left
$34.99
MSA Altair H2S Gas Detector 33 Months Left picture






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