Applying Timezone Offset vs. Coverting Date to UTC Format
Posted on 2006-07-18
I'm developing an application for a client which allows registered users to schedule email reminders to be sent to themselves on a specific day and time.
In the database, for each scheduled reminder, .. I am storing the following information:
1. The date of the actual event
2. The number of days before the event that the reminder email should be sent
3. The Timezone offset value (based on the user's U.S. timezone selection - 4 different choices)
4. The specific time of day that the reminder email should be sent (based on 24 hour time)
I now need to set up a scheduled process on the server which will run once every hour, and which will send out the email reminders if the calculated date/time values match.
For example, .. when the scheduled process runs at 7:00 am on 7/18/2006, .. and if there is a record in the database which indicates that there is an event on 7/19/2006 for which a reminder email should be sent one day in advance (also at 7:00 am) then the reminder email should be sent.
The problem that I'm having is that I was advised to convert all of my dates to UTC using the DateConvert() function, .. and I'm beginning to suspect that this step might NOT necessary, and that my simply adjusting the date/time values based on the timezone offset (for both the server time and the date/time on which the reminder email shoud be sent) should be adequate.
So my question is this: If I know where the server is physically located (and what the timezone offset value for it is), .. and if I have the timezone offset value for each reminder stored in the database, .. shouldn't that be enough for me to work with and send out my reminder emails on/at the correct day and time? Or is still necessary for me to convert the date/time values to UTC format using DateConvert() ?
Thanks in advance,