java - how to convert this date format 2017-07-28T04:13:40.398Z to normal date format .? -
this question has answer here:
from 2017-07-28t04:13:40.398z
, need normal date yyyy-mm-dd hh:mm:ss
or hh:mm
how can this?
i tried this
simpledateformat sdf = new simpledateformat("yyyy-mm-dd't'hh:mm:ss.sssz"); simpledateformat output = new simpledateformat("yyyy-mm-dd hh:mm:ss"); date d = sdf.parse(value); string formattedtime = output.format(d);
z
can't parse utc timezone z. can use 1 of these formats:
yyyy-mm-dd't'hh:mm:ss.sss`z` //will work utc timezone yyyy-mm-dd't'hh:mm:ss.sssx //use x parse iso compliant timezones
Comments
Post a Comment