[AccessD] Comparing times in different time zones

Stuart McLachlan stuart at lexacorp.com.pg
Mon Oct 24 23:44:51 CDT 2011


How are these times being entered into the database?  Can't you convert the local time to 
UTC before saving?   The computer where the data is being entered always knows its 
current offset from UTC.  

-- 
Stuart

On 24 Oct 2011 at 23:37, Kenneth W Van Huss wrote:

> I found a table, but don't recall where, that has the offset for all
> the countries with which I am currently dealing.  I added a field to
> the location table that includes the UTC Offset.  So for Iraq, I take
> the local time and convert it to UTC/GMT using the offset in the
> location table.  I take the server time, US Central, and convert it to
> UTC/GMT.  Now I can compare the time of the event against the time it
> was entered into the database.  So right now as we write, the
> comparison is fine.  
> 
> But it will become a maintenance nightmare on an ongoing basis, I
> think because these offsets change depending on time of year and
> Daylight Savings Time.  Keeping in synch will be a real challenge. 
> What happens for example if an event occurs the morning of transition
> to or from DST in a time zone that just changed, and we need to
> compare it against server time 8 time zones away, which has not yet
> switched to DST.  
> 
> I guess I can't see the forest for the trees right now and need some
> clarity.   Any ideas are greatly appreciated.
> 
> 
> 
> 
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darryl
> Collins Sent: Monday, October 24, 2011 10:27 PM To: Access Developers
> discussion and problem solving Subject: Re: [AccessD] Comparing times
> in different time zones
> 
> Bloody hell Ken,
> 
> That is going to be a struggle to get right given all the Local time
> zones you are going to need to deal with. Just in Oz alone it is a
> mess with some states on Daylight saving time and other states ignore
> it.  This leads to stupid situations where you will have two cities in
> the same zone being 1 hour apart.
> 
> I am sure Australia doesn't have a monopoly on this sort of weirdness.
> 
> I deal a lot with Asia and the US and Africa these days so I use this
> website <<http://www.timeanddate.com/worldclock/>> to keep track of
> different times, maybe it can help you out?
> 
> I guess it depends on where you are grabbing the offset from and if it
> is automatically updated or not?
> 
> 
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth W
> Van Huss Sent: Tuesday, 25 October 2011 2:13 PM To: Access Developers
> discussion and problem solving Subject: [AccessD] Comparing times in
> different time zones
> 
> I have an unmet challenge relating to comparing times in different
> time zones.  User on the other side of the world, literally enters
> time of an event.  When the user saves the record in the database that
> time is captured, though the time is the server time, located in US
> central time zone.  Using UTC offset I have "normalized" the times to
> UTC to compare against one another to ensure the record was entered
> within a certain amount of time.  The challenge I see down the road is
> Day Light Savings time and the impact that will have on the offset. 
> Anyone experience this before?
> 
> 
> 
> Thanks!
> 
> Ken
> 
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 
> 
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 






More information about the AccessD mailing list