java - Android converting Facebook time to Date -
i've received start_time facebook query:
2013-05-30t19:30:00+0300
how can parse date in android ?
i've tried this:
simpledateformat formatter = new simpledateformat("yyyy-mm-dd't'hh:mm:ss' '");
use yyyy-mm-dd't'hh:mm:ssz
format below...
string datestring = "2013-05-30t19:30:00+0300"; simpledateformat dateformat = new simpledateformat("yyyy-mm-dd't'hh:mm:ssz"); date date = dateformat.parse(datestring); dateformat = new simpledateformat("yyyy-mm-dd hh:mm"); string formateddate = dateformat.format(date); log.d("date", formateddate);
output:
03-10 18:29:47.074: d/date(27257): 2013-05-30 10:30
Comments
Post a Comment