I have the following problem...
My website will be used by users all over the world.
They have the option to save a blog.
1. When they save it I want to show to them the time they saved it...LOCAL time ofcourse.
BUT, when another user from a different part in the world views this blog, the save time might be in the future....kinda stupid...
2. If I use the datetime.now option the save time will always be the server time....so then it might be that when Im in the UK and the server is in the US, when I save my blog at 11:00 local time, the date I will see when I saved it is 11:00-8 hours, would
be 03:00...
I can hardly imagine im the first to run into this problem, so Im really curious how other people have handled this issue...do I need to store a GMT time in the DB and on each request check where the current user is from...but then how would I handle a save
date which would be in the future...see option 1 above....
please mark answers as 'Answered' and post back solutions when you figure stuff out that isnt in the post already.
Peter Smith
Contributor
4605 Points
2109 Posts
timezones
Jun 02, 2006 03:54 PM|LINK
My website will be used by users all over the world.
They have the option to save a blog.
1. When they save it I want to show to them the time they saved it...LOCAL time ofcourse.
BUT, when another user from a different part in the world views this blog, the save time might be in the future....kinda stupid...
2. If I use the datetime.now option the save time will always be the server time....so then it might be that when Im in the UK and the server is in the US, when I save my blog at 11:00 local time, the date I will see when I saved it is 11:00-8 hours, would be 03:00...
I can hardly imagine im the first to run into this problem, so Im really curious how other people have handled this issue...do I need to store a GMT time in the DB and on each request check where the current user is from...but then how would I handle a save date which would be in the future...see option 1 above....