The time-zone is not part of the actual state of .Īn Instant also does not contain any information about the time-zone. However that method actually uses Java's default time-zone on the fly to provide the string. This might seem strange if you call toString() on a, because the toString is relative to a time-zone. The equivalent class to in JSR-310 is Instant, thus there are convenient methods to provide the conversion to and fro: Date input = new Date() Ī instance has no concept of time-zone. The actual data stored within the object is a long count of milliseconds since T00:00Z (midnight at the start of 1970 GMT/UTC). ![]() ![]() LocalDateTime ldt = LocalDateTime.ofInstant(in.toInstant(), ZoneId.systemDefault()) ĭate out = om(ldt.atZone(ZoneId.systemDefault()).toInstant()) ĭespite its name, represents an instant on the time-line, not a "date".
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |