Closed plemanach closed 1 year ago
Hello,
is there any plan to replace these deprecated types :
import java.util.date; import java.sql.Date; import java.sql.Time; import java.sql.Timestamp;
https://www.baeldung.com/java-8-date-time-intro
The main concern with the current old java type is the fact the epoch is altered to show the UTC date/time with the local hidden time zone from java.util.date.
`long getTzOffset(long x){ return tz.getOffset(x); }
long lg(long x){ return x+getTzOffset(x); } long gl(long x){ return x-getTzOffset(x-getTzOffset(x)); }`
so you cannot use java.util.Date.toInstant() to get the accurate epoch.
I created a pull request to show how that could work : #57
Best Regards,
Patrice
Changes now in master branch for forthcoming release. Thanks for previous PR.
Hello,
is there any plan to replace these deprecated types :
import java.util.date; import java.sql.Date; import java.sql.Time; import java.sql.Timestamp;
https://www.baeldung.com/java-8-date-time-intro
The main concern with the current old java type is the fact the epoch is altered to show the UTC date/time with the local hidden time zone from java.util.date.
`long getTzOffset(long x){ return tz.getOffset(x); }
long lg(long x){ return x+getTzOffset(x); } long gl(long x){ return x-getTzOffset(x-getTzOffset(x)); }`
so you cannot use java.util.Date.toInstant() to get the accurate epoch.
I created a pull request to show how that could work : #57
Best Regards,
Patrice