..
Android Smart Visitor

Get time zone where currently running, using TimeZone.getDefault()

August 09, 2011 | By Andro ID

The method TimeZone.getDefault() returns the user's preferred time zone.



example:



        TextView textTimeZone = (TextView)findViewById(R.id.timezone);



TimeZone timezone = TimeZone.getDefault();

String TimeZoneName = timezone.getDisplayName();

int TimeZoneOffset = timezone.getRawOffset()/(60 * 60 * 1000);



textTimeZone.setText("My Time Zone\n" +

TimeZoneName + " : " +String.valueOf(TimeZoneOffset));






Related Post:

- Get Installed Time Zone


addtomyyahoo4 Subscribe in NewsGator Online Add to My AOL
Subscribe with Bloglines Add to netvibes Add to Google