jodatime - Last milliseconds of a day in ISO format in Java -
i have string representations of dates need convert date objects. need start of day , end of day in datetime down millisecond. here have far:
date format is:
yyyy-mm-dd't'hh:mm:ss.sss'z'
start of day:
2013-05-19t00:00:00+00:00
end of day:
2013-05-19t23:59:59+59:59
the 'start of day' parses ok 'end of day' throws
java.lang.illegalargumentexception: invalid format: "2013-05-19t23:59:59+59:59" malformed @ "59:59"
the bit after +
isn't milliseconds. +
introduces timezone offset. +00:00
gmt (greenwich mean time). +01:00
hour later (cet; central european time).
for last millisecond of day, want:
2013-05-19t23:59:59.999 milliseconds -------^^^
note that's .
before 999
, because we're writing there 59.999
seconds.
if want to, can add timezone indicator on that, e.g.:
2013-05-19t23:59:59.999+00:00
Comments
Post a Comment