I have an Instant instance (org.joda.time.Instant) that I get in some api response. I have another instance from (java.time.Instant) that I get from another call. Now I want to compare these two objects to check which one to get the last one. How is this possible?
getMillis()from joda.time can be compared toEpochMilli()to java.time.
getMillis()
toEpochMilli()
Class Documentation:
Sample code.
java.time.Instant myJavaInstant = java.time.Instant.ofEpochMilli( myJodaInstant.getMillis() ) ;
Going the other way.
// Caution: Loss of data if the java.time.Instant has microsecond // or nanosecond fraction of second. org.joda.time.Instant myJodaInstant = new org.joda.time.Instant( myJavaInstant.toEpochMilli() );
joda Instant java (datetime - ):
org.joda.time.Instant.parse("10.02.2017 13:45:32", DateTimeFormat.forPattern("dd.MM.yyyy HH:mm:ss")).toDate().toInstant()
, toDate() toInstant() joda Instant.
toDate()
toInstant()
Source: https://habr.com/ru/post/1648822/More articles:Python receives notification using Google Drive - push-notificationAn ambiguous variable of type `a0 ', arising from the use of` it' - functional-programmingHow to add longitude and latitude lines on a map using ggplot2? - rGet all notifications from firebase - iosSpeeding up cross-reference filtering in Pandas DB - performanceDifference between __new__ and __init__ order in Python2 / 3 - pythonNumpy Conditional Max Range - pythonpython Iterate through dataframe columns - pythonHow to start collecting ICE peer candidates - javascriptПроблема с циклизацией определенных элементов в вложенных дескрипторах импортированных массивов - javascriptAll Articles