android - GMT date and time to convert Local device Date Time? -


hi got web service result 6/26/2013 12:00:00 gmt how make convert local device time.please give me solution

i have implement code not working

public static string datetime(date date) {     simpledateformat dateformat = new simpledateformat("mm/dd/yyyy hh:mm a");     return dateformat.format(date); } 

set timezone formatter before parsing date.

public static string datetime(date date) {     simpledateformat dateformat = new simpledateformat("mm/dd/yyyy hh:mm a");     timezone tz = timezone.getdefault(); //will return device current time zone     dateformat.settimezone(tz); //set time zone simple date formatter     return dateformat.format(date); }     

Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -