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.

http://dataservice.accuweather.com/currentconditions/v1/257072?apikey=jtgpz8wn9vuy07gaoodezfz3sam12irh&language=en-us&details=true

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

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -