Sunday 15 April 2012

Android/Java | Wrong time string, but using correct Locale? -


I'm trying to get the current time, but it displays in the wrong format. for example. Here, now it is 00:20 and it's showing 12:20. What am I doing wrong?

  SimpleDataformatetime sdfTime = New SimpleDateform ("hh: mm", locale.GMNAI); Date now = calendar.Ast Instance (). GetTime (); Tv_Time.setText (sdfTime.format (today));  

PS: I tried

  calendar .getInstance (Locale.GERMANY) .getTime ();  

Also, but it still does not work.

.

If you want a locale-dependent time format, use it.


No comments:

Post a Comment