Quantcast
Channel: Is java.sql.Timestamp timezone specific? - Stack Overflow
Browsing all 8 articles
Browse latest View live

Answer by problem solver for Is java.sql.Timestamp timezone specific?

If your problem is to get a timestamp of the local zone, you can use this:Timestamp.from(Instant.now()).toLocalDateTime()

View Article



Answer by Douglas Surber for Is java.sql.Timestamp timezone specific?

The answer is that java.sql.Timestamp is a mess and should be avoided. Use java.time.LocalDateTime instead.So why is it a mess? From the java.sql.Timestamp JavaDoc, a java.sql.Timestamp is a "thin...

View Article

Answer by Ayush Kumar for Is java.sql.Timestamp timezone specific?

You can use the below method to store the timestamp in database specific to your desired zone/zone Id.ZonedDateTime zdt = ZonedDateTime.now(ZoneId.of("Asia/Calcutta")) ;Timestamp timestamp =...

View Article

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

For Mysql, we have a limitation.In the driver Mysql doc, we have :The following are some known issues and limitations for MySQL Connector/J: When Connector/J retrieves timestamps for a daylight saving...

View Article

Answer by Evgeniy Dorofeev for Is java.sql.Timestamp timezone specific?

I think the correct answer should be java.sql.Timestamp is NOT timezone specific. Timestamp is a composite of java.util.Date and a separate nanoseconds value. There is no timezone information in this...

View Article


Answer by Mark Rotteveel for Is java.sql.Timestamp timezone specific?

Although it is not explicitly specified for setTimestamp(int parameterIndex, Timestamp x) drivers have to follow the rules established by the setTimestamp(int parameterIndex, Timestamp x, Calendar cal)...

View Article

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

It is specific from your driver. You need to supply a parameter in your Java program to tell it the time zone you want to use.java -Duser.timezone="America/New_York" GetCurrentDateTimeZoneFurther this:...

View Article

Is java.sql.Timestamp timezone specific?

I have to store UTC dateTime in DB.I have converted the dateTime given in specific timezone to UTC. for that I followed the below code.My input dateTime is "20121225 10:00:00 Z" timezone is...

View Article

Browsing all 8 articles
Browse latest View live




Latest Images

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