[android-developers] Re: How to get current time?

2009-06-08 Thread Mark Murphy
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

[android-developers] Re: How to get current time?

2009-06-08 Thread Jeff Sharkey
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

[android-developers] Re: How to get current time?

2009-06-09 Thread Mark Murphy
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

[android-developers] Re: How to get current time?

2009-06-09 Thread Mike Lanin
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

[android-developers] Re: How to get current time?

2009-06-10 Thread Mike Garcia
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

[android-developers] Re: How to get current time?

2009-06-17 Thread Karima
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

[android-developers] Re: How to get current time?

2009-06-17 Thread Jeff Sharkey
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

[android-developers] Re: How to get current time?

2009-06-17 Thread Mark Murphy
> 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

[android-developers] Re: How to get current time?

2009-06-17 Thread Delta Foxtrot
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

[android-developers] Re: How to get current time?

2009-06-17 Thread sm1
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

[android-developers] Re: How to get current time accurately?

2010-02-18 Thread ko5tik
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