Re: Calc time difference between two date/time/zones



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.
.



Relevant Pages

  • Re: Formula Too Long Issue
    ... of 0 ...hence subtract one. ... can learn more about offset in the formula. ... Try making the cell references in the formula shorter ...
    (microsoft.public.excel.misc)
  • Re: Professional Genealogy Software
    ... Charlie Hoffpauir wrote: ... Time) Was originally selected because it was directly opposite (12 hours offset) from a line on the globe stretching from north to south pole which passed through the minimum amount of land possible and thus the International Date line. ... computer and otherwise use this as the basis for recording time and interpreting between time zones. ... it's originator by 5 different genealogists over ...
    (soc.genealogy.computing)
  • Re: Win32 SEH question
    ... .COD file will have the offset as the first bit on each assembler line. ... your offending instruction address, subtract 401000, look in your map file to find the function where that offset would ... >> EIP will show you exactly the offending instruction. ... > to maintain a map file but how do I maintain a list file in Visual C++ 6.0? ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Daylight saving come up soon
    ... DST, time zones, etc. ... web atomic clock etc. or just that it behaved within a minute or two ... And the offset must be dynamicly calculated based on the ...
    (comp.lang.java.programmer)
  • Re: Magic Flight: A Public Key Algorithm Based on a Lossy Commutative Rng Mixer
    ... > merely translates the result to a higher range. ... doesn't really go back to the offset branch or ... >> When in the course of Gaussian Elimination, you subtract the ...
    (sci.crypt)