I can't find any java.util.Time class in my Android sdk...maybe you
wanna suggent java.util.Date ?

On 18 Mar, 15:53, Mark Murphy <[email protected]> wrote:
> On Fri, Mar 18, 2011 at 10:42 AM, Andrea Richiardi
>
> <[email protected]> wrote:
> > Hi guys, I would like to ask you something about the Time class.
>
> Note that you are referring to android.text.format.Time, not java.util.Time.
>
> > I'm trying to grab time doing:
>
> > Time now = new Time();
> > now.setToNow();
>
> > But if I have my phone set to the AM/PM behaviour, now.hour returns me
> > a < 12 number, even if noon is gone by. Am I wrong doing something?
>
> Yes. You should be using java.util.Time to get the time.
> android.text.format.Time is for rendering the time as a string.
>
> > Second question, is there an alternative way to get the current time?
>
> Use java.util.Time.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9
> Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to