In my current project, I am facing a challenge while attempting to pass UTC time from a JavaScript front end to a Java backend. My initial approach involved utilizing the Date.toISOString()
method and sending the generated object to the Java backend. However, I encountered an issue where the output format of toISOString()
(YYYY-MM-DDTHH:mm:ss.sssZ
) does not align with any of the predefined formatters for LocalDateTime
in Java 8.
Asking for recommendations or best practices, I am wondering if there exists a standardized method for achieving this task. While I acknowledge that creating a custom Java formatter to match the JavaScript output is a viable solution, I am curious if there is a commonly accepted practice due to the frequency of scenarios like mine in development projects.