Monday 20 August 2018

How to format date string in java?





Hi i have the following string:2012-05-20T09:00:00.000Z
and i want to format it to be like 20/05/2012, 9am




How to do so in java?



Thanks


Answer



use SimpleDateFormat to first parse() String to Date and then format() Date to String


No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...