"RokuMarkn" wrote:
"scaper12123" wrote:
Admittedly the possibilities of time-zone differences have made me lag a bit but that's about the worst of it.
When you asked about using AsSeconds in another thread, I said "assuming both roDateTimes are in GMT, this will work". I emphasize again that you must operate in GMT. NEVER use local time for any time calculations -- it will fail, due to the fact that local time is neither monotonic nor unambiguous (for example, the local time 1:30am occurs twice on the same day when Daylight Saving Time ends). The only thing local time should be used for is to display times to the user.
--Mark
Good point. I've edited my example code above to display the time using the user's local time zone. As Mark said, make sure the time calculations are done using GMT time. If your server returns time in a different time zone, then convert from that time zone to GMT before doing any further calculations on the time.