Skip to content

Commit

Permalink
Fixed dateTime parse issue on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
felipeucelli committed Jun 30, 2024
1 parent f61dda5 commit 46ce10f
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.time.Instant;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.*;
Expand Down Expand Up @@ -584,7 +586,9 @@ private Object[] interpretStatement(String stmt, LocalNameSpace localVars, int a
String left = result.get(0).substring(1).replace("\"", "");
String right = result.get(1);

Instant instant = Instant.parse(left);
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
ZonedDateTime zonedDateTime = ZonedDateTime.parse(left, formatter);
Instant instant = zonedDateTime.toInstant();

expr = dump(instant.toEpochMilli(), localVars) + right;
}else {
Expand Down

0 comments on commit 46ce10f

Please sign in to comment.