java - String date into Epoch time -
i little bit confused in dates. working on weather app , works fine .. wanna handle type of format own desirable format.
2017-09-10t18:35:00+05:00
i wanna convert date epoch time , settle date in desire format ::
for j-son
or wanna convert date less figure i.e sun , 9 september 9:23 etc.
use simpledateformat
instance parse string date
object:
dateformat parser = new simpledateformat("yyyy-mm-dd't'hh:mm:ssx"); date date = parser.parse("2017-09-10t18:35:00+05:00");
and use simpledateformat display it:
dateformat format = new simpledateformat("eee, dd mmmmm h:mm a"); string formatted = format.format(date); // sun, 10 september 1:35 pm
Comments
Post a Comment