Mike Lanin wrote:
> Hi! I'm just trying to find the way to get current time. But I don't
> want to use currentTimeMillis() method, because the current time on
> device may be wrong. Is there any way to make some request to the
> Internet to get right current time?
There are a few Java NTP and SNT
So just a heads up that Android uses NITZ events provided by a carrier
to properly set the system date and time. Android also falls-back to
network NTP automatically when no cellular network is available.
http://en.wikipedia.org/wiki/NITZ
The time provided by currentTimeMillis() will typically
Jeff Sharkey wrote:
> So just a heads up that Android uses NITZ events provided by a carrier
> to properly set the system date and time. Android also falls-back to
> network NTP automatically when no cellular network is available.
>
> http://en.wikipedia.org/wiki/NITZ
>
> The time provided by c
Thanks! I'll just use currentTimeMillis().
On 9 июн, 16:01, Mark Murphy wrote:
> Jeff Sharkey wrote:
> > So just a heads up that Android uses NITZ events provided by a carrier
> > to properly set the system date and time. Android also falls-back to
> > network NTP automatically when no cellular
Or you can do something like this...
Date d = new Date();
d.getTime();
I personally prefer this but only because I have access to other functions
for outputing the time in a human readable form without having to write a
bunch of extra code.
2009/6/9 Mike Lanin
>
> Thanks! I'll just use current
may be with :
import android.text.format.Time;
Time time = new Time();
time.setToNow();
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-develope
So I made the NTP assumption based on seeing things scroll by in
logcat, but after digging deeper, it looks like it doesn't actually
change the system clock. (Instead it's used for GPS somehow?)
D/GpsLocationProvider( 5839): Requesting time from NTP server
north-america.pool.ntp.org
D/InetAddres
> So I made the NTP assumption based on seeing things scroll by in
> logcat, but after digging deeper, it looks like it doesn't actually
> change the system clock.
Hrm. I assume the NTP API isn't somewhere that Java code can access, which
means we're back to using an existing Java NTP/SNTP client
2009/6/18 Mark Murphy
> Hrm. I assume the NTP API isn't somewhere that Java code can access, which
> means we're back to using an existing Java NTP/SNTP client library if we
> want an accurate time regardless of whether we are on a network that is
> NITZ capable.
>
Why install a NTP daemon if it
The documentation for SystemClock will give you a nice summary of your
choices of current times with Android at
http://developer.android.com/reference/android/os/SystemClock.html
serge
On Jun 17, 7:15 pm, Delta Foxtrot wrote:
> 2009/6/18 Mark Murphy
>
> > Hrm. I assume the NTP API isn't somew
On Feb 18, 9:44 am, Yoshinori wrote:
> Hi
>
> I want to get current time accurately.
> I tried to get the time by "System.currentTimeMillis()" but it has the
> effect on the modificaion by User. So it is not useful for me.
>
> Could you kindly tell me how to get current time accurately?
Use Sys
11 matches
Mail list logo