vendredi 17 avril 2015

Java Get UTC Time

Trying to insert UTC time into MySql Column with data type DATETIME, and I'm using Joda library. However, this 2 statement both insert local time into database. Why?



stm.setTimestamp(10, new Timestamp(DateTime.now().getMillis()));

stm.setTimestamp(10, new Timestamp(DateTime.now(DateTimeZone.UTC).getMillis()));


EDIT


I checked previous project code, similar(same) code works on another database. Because I'm using AWS RDS MySql Database, and tried to set time_zone = '+0:00' with no luck.





Aucun commentaire:

Enregistrer un commentaire