Last post Aug 29, 2007 11:01 PM by DLL
Aug 29, 2007 09:31 PM|DLL|LINK
I have a task where I have to ensure all date handling is in UTC format and am wondering how to go about it? Any good articles etc .. ?
We are using MySQL databases and have a couple around the world.
Would you look at the IP address of the user to see what country they are in and then save and display the date to them depending on that. So for example if person 1 saves something at 8pm in Australia it gets saved to the database in UTC format then person
2 checks the same data in the UK he would see it not as 9pm but as 11am (or whatever)? Is using the IP address reliable?
Is that basically how it works? What about culture info etc?
Thanks a lot
Aug 29, 2007 09:55 PM|jocc|LINK
This is a good article about UTC:
Aug 29, 2007 11:01 PM|DLL|LINK
Thanks for the article,
I read it all. It says in the conclusion that storing in UTC fomat is one step in the right direction because of time difference and day light saving confusions.
So does anyone know if it's more complicated then just saving into the database using DataTime.UtcNow() and retrieving from the database using ValueFromDatabase.ToLocalTime();?
Is it as easy as that? When you save to the database using UtcNow() does it take day light saving times into account? or would I have to do some sort of If statement lie:
If dayLightSaving Then UtcNow()+1