TimeZone changes Java and Database

rajitha

I want to know how we can manage time zone related changes with Java and Databases. When there is a time change in a particular country (Daylight Saving Time or Some other reason Ex. Russia change time 1 hour backward ) how we can made that change without affecting the code.

"without affecting the code" means without changing the code. Just using some configurations.

SimY4

Use UTC Server-Side

Typically in database you store dates in UTC. You perform date translation after you fetch it to avoid time zone change problems.

tz database

For Java, you can obtain fresh time zone data. Download the latest version of tzdata file, also known as the "Olson database". Add that file to your JVM bundle. See these instructions.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related