I am using following specifications in my current project (production)
The database is in separate server than application server but both are in same LAN.
Datatype in mysql table is: date
for storing date only and datetime
for saving date along with time.
The problem is mysql saved every date 1 day earlier than the date provided from applcation. I have tried the following till now but still no luck:
What am I missing? Can anybody suggest?
Thanks to all for sharing your experience regarding the issue.
At last, I solved it by changing the serverTimezone
attribute of mysql connection string in dispatcher-servlet
of my java web application.
<property name="url" value="jdbc:mysql://x.x.x..x:3306/dbname?characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Dhaka" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With