Created
June 29, 2016 07:59
-
-
Save ruan65/e2714e63e25a129eb7c1730623461f94 to your computer and use it in GitHub Desktop.
getDateStringFromMaximoTimeFormat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String getDateStringFromMaximoTimeFormat(String datestring) { | |
final String ISO8601DATEFORMAT = "yyyy-MM-dd'T'HH:mm:ss"; | |
Calendar calendar = Calendar.getInstance() ; | |
SimpleDateFormat dateformat = new SimpleDateFormat(ISO8601DATEFORMAT, Locale.getDefault()); | |
try { | |
Date date = dateformat.parse(datestring.substring(0, 19)); | |
date.setHours(date.getHours()-1); | |
calendar.setTime(date); | |
} catch (ParseException e) { | |
e.printStackTrace(); | |
} | |
SimpleDateFormat df = new SimpleDateFormat("dd MM yyyy"); | |
return df.format(calendar.getTime()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment