Hi All,
Is there a difference between DateTimeFormatter and SimpleDateFormat
in respect of parsing milliseconds? This is my test code:
String pattern = "yyyyMMddHHmmssSS";
SimpleDateFormat javaDateFormatter = new SimpleDateFormat(pattern);
DateTimeFormatter jodaDateFormatter = DateTimeFormat.forPattern(pattern);
String tsStr = "2012.03.07.17.15.07.91".replace(".", "");
// SimpleDateFormatwill parse 91 as 91ms, Joda 2.0 will parse it as 910ms
Date javaDate = javaDateFormatter.parse(tsStr);
Date jodaDate = jodaDateFormatter.parseDateTime(tsStr).toDate();
assertThat(jodaDate.getTime() - 910 + 91, equalTo(javaDate.getTime()));
Regards
Wojtek
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Joda-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/joda-interest