switch from joda.time to java.time
Close #98
Depends on https://github.com/steve-community/ocpp-jaxb/pull/16
i considered this years ago but then dismissed the topic, because of the following...
joda's DateTime is forgiving if the timezone designator is missing. timezone designator is a MUST for java's data types. you can imagine joda's DateTime as a union of multiple possible date-time types in java.time package. since some weird charging station implementations do NOT send timezone, i decided to stay with joda's DateTime back then. sad but true. otherwise, we would break compatibility.
test code:
public static void main(String[] args) {
// this will work fine for both
{
String s = "2025-04-03T09:30:00.00000+02:00";
DateTime dt1 = DateTime.parse(s);
System.out.println(dt1);
OffsetDateTime dt2 = OffsetDateTime.parse(s);
System.out.println(dt2);
}
// this will explode in case of OffsetDateTime
{
String s = "2025-04-03T09:30:00";
DateTime dt1 = DateTime.parse(s);
System.out.println(dt1);
OffsetDateTime dt2 = OffsetDateTime.parse(s);
System.out.println(dt2);
}
}
You are right, but the issue doesn't exist because already treated. See https://github.com/steve-community/ocpp-jaxb/pull/16/files#r2026501536
Neat! Let's continue the conversation there.
Closing this PR due to inactivity. Feel free to reopen if needed. See: https://github.com/juherr/evolve/pull/1