I try to format a timestamp using a SimpleDateFormat
and also I try to use the same format to parse such a formatted date:
SimpleDateFormat sdf = new SimpleDateFormat("MMM d, YYYY 'at' hh:mma z");
GregorianCalendar cal = new GregorianCalendar(Locale.US);
sdf.setTimeZone(cal.getTimeZone())
sdf.parse(sdf.format(1435271907000L)).getTime() == 1435271907000L
the last expression is false, the actual result is 1419806280000L
So how is it possible to achive a symmetrical dateTimeFormat parsing/formatting behaviour?