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

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -