Sunday, 15 May 2011

android - Get time zone against a country/region -



android - Get time zone against a country/region -

i looking code displays list of countries/regions in android , selecting specific country/region, displays time zone of it. illustration when take "central america" country/region should displays "utc-06:00" time zone. want know if android provide functionality default or list downwards countries/regions in array , time zones in array , create logic.

i have used next code no success

dateformat format = new simpledateformat("mmmmm d, yyyy, h:mm a"); timezone utc = timezone.gettimezone("central america"); system.out.println(utc.getid()); log.d("time", utc.getid()); gregoriancalendar gc = new gregoriancalendar(utc); date = gc.gettime(); system.out.println(format.format(now)); log.d("time", format.format(now));

android timezone

No comments:

Post a Comment