Quantcast
Channel: Is java.sql.Timestamp timezone specific? - Stack Overflow
Viewing all articles
Browse latest Browse all 9

Answer by justCurious for Is java.sql.Timestamp timezone specific?

$
0
0

My solution:

Timestamp.valueOf(ZonedDateTime.now(ZoneOffset.UTC).toLocalDateTime())

For database purpose, I recommend you to use: OffsetDateTime.Please avoid the java.sql.Timestamp for database fields. It is old and not so friendly to work with new Java date time format (and time offsets)


Viewing all articles
Browse latest Browse all 9

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>