Re: Calc time difference between two date/time/zones
- From: Dr J R Stockton <jrs@xxxxxxxxxxxxxxxxxx>
- Date: Fri, 17 Oct 2008 16:35:58 +0100
In comp.lang.pascal.delphi.misc message <c55d89ca-5419-4600-9c40-b07a568
e2763@xxxxxxxxxxxxxxxxxxxxxxxxxxx>, Thu, 16 Oct 2008 13:32:11, battles
<battles@xxxxxxxxxxxxxx> posted:
I have been searching and cannot find a way to determine the time
between two date/time/zones as shown below.
NO. Those are not time zones, they ate time offsets. Time Zones do not
change seasonally.
Does anyone have a
routine that can do this easily without having to manually convert
everything to gmt? Thanks.
16 Oct 2008 07:57:01 -0500
16 Oct 2008 20:58:59 +0800
-----------------------------------------
= 4 seconds
15 Oct 2008 07:57:01 -0500
16 Oct 2008 01:58:59 +0800
-----------------------------------------
= 5 hrs 4 secs
To subtract those, firstly subtract the date and time treating them as
UTC or your-local, then correct by the difference in offset. Since days
and months are of variable lengths, the result is not technically
meaningful if expressed in any unit greater than hours. If the task is
administrative and requires larger units, look up the applicable
definition.
For the actual differencing, subtract TDateTimes, and treat the result
as a float of days.
For the difference between date/times at different known PLACES, you
want the Summer Time Rules and the Standard Offset - which can be
combined in TZ strings. There is code for this in dateunit.zip and/or
dateutys.pas, via sig line 3.
--
(c) John Stockton, nr London UK. ?@merlyn.demon.co.uk DOS 3.3, 6.20; WinXP.
Web <URL:http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms & links.
PAS EXE TXT ZIP via <URL:http://www.merlyn.demon.co.uk/programs/00index.htm>
My DOS <URL:http://www.merlyn.demon.co.uk/batfiles.htm> - also batprogs.htm.
.
- References:
- Calc time difference between two date/time/zones
- From: battles
- Calc time difference between two date/time/zones
- Prev by Date: Pascal analyzer - Yacc?
- Next by Date: Re: Pascal analyzer - Yacc?
- Previous by thread: Re: Calc time difference between two date/time/zones
- Next by thread: Pascal analyzer - Yacc?
- Index(es):
Relevant Pages
|