![]() (And then, hopefully, I could change the server time to UTC and nobody would notice anything had happened.)īut, to make matters worse, Daylight Savings has elapsed a few times in the past year and a half, so the simple approach of adding 5 hours to every datetime won't work, either. I've been looking through some examples using CONVERT but these seem to just do that on the fly - not actually modify the data in the database. By this, I mean literally modifying any DATETIME attributes for every single record, since changing the time zone on the server won't adjust those. ![]() I'm wondering what an easy way is of changing all the DATETIMEs in all the databases from Eastern time to UTC. I know the best practice is to always use UTC, and I'd like to "cutover" to that now. I've added some code in the application to be able to convert times to the local time zone in anticipation of changing this. For the past year and a half or so, our database server has been using Eastern Time, and the DATETIME type is used almost exclusively so datetimes in our databases have been timezone independent, since just the timestamp is stored.
0 Comments
Leave a Reply. |