I have a C# time application where the user can create a timer and start it, it will do something like that on the server:
(the dates are stored in CEST (the problem is summer and winter time))
// insert into db
var entry = new TimeEntry();
entry.Start = DateTime.Now; (04/03/2013 12:00)
_timeEntries.Add(entry); // => now it's in the db
if he stops it then it do something like that:
// update the entry
var entry = _timeEntries.Get(1) // 1 is the id from the created entry before
entry.End = DateTime.Now; (04/03/2013 12:37)
_timeEntrires.Update(entry); // => now it updates it in the db
Something like that will be shown for the user in the browser:
TimerId: 1
Start: 04/03/2013 12:00
Stop: 04/03/2013 12:25
Total (in min): 25
Now I think there will be some problems when the user changes his timezone. What's the best way to solve this? Store the dates as UTC and then convert with JavaScript?
Thanks for your helps :-).