Hey guys I have the date "01.01.1000 AD"
(SimpleDate) as String and dd.MM.yyyy G
(SimpleFormat) and need to parse it into a Standard ISO-Date in the form 1995-12-31T23:59:59Z
(yyyy-MM-dd'T'hh:mm:ss'Z'
)
my actual code is:
public static String getISODate(String simpleDate, String simpleFormat, String isoFormat) throws ParseException {
Date date;
if (simpleFormat.equals("long")) {
date = new Date(Long.parseLong(simpleDate));
} else {
SimpleDateFormat df = new SimpleDateFormat(simpleFormat);
df.setTimeZone(TimeZone.getTimeZone("UTC"));
// or else testcase
// "1964-02-24" would
// result "1964-02-23"
date = df.parse(simpleDate);
}
return getISODate(date, isoFormat);
}
Does anyone have an idea how do I do that?