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



On Oct 17, 8:29 am, David Kerber
<ns_dkerber@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
In article <8301ddd9-29cb-41dd-9f28-38109f4b7e97
@p59g2000hsd.googlegroups.com>, batt...@xxxxxxxxxxxxxx says...



On Oct 16, 4:52 pm, Kenneth Porter <shiva.blackl...@xxxxxxxxxxxxxxx>
wrote:
battles <batt...@xxxxxxxxxxxxxx> wrote in news:c55d89ca-5419-4600-9c40-
b07a568e2...@xxxxxxxxxxxxxxxxxxxxxxxxxxx:

I have been searching and cannot find a way to determine the time
between two date/time/zones as shown below. Does anyone have a
routine that can do this easily without having to manually convert
everything to gmt? Thanks.

You picked two "simple" time zones. Will it always be those two? If not,
you're better off using a library routine to convert them to UTC for
arithemetic, as time zones can get very strange. Daylight Saving Time will
make it very complicated when you're near a DST transition.

This is what I am afraid of. It could be any time zone. Do you
know of a
library routine that does this?

Will datediff not handle this directly (I haven't tried it)? If not,
then it should work if you convert them to GMT first, and then use
Datediff on those values.

--
/~\ The ASCII
\ / Ribbon Campaign
X Against HTML
/ \ Email!

Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).


It seems to only do dates. I am thinking of just converting
everything with DecodeTime and DecodeDate to seconds and then back to
time after subtracting. I was hoping that there was some kind of
library that you could pass 2 date/time/timezones to and get the
difference back. Thanks.
.



Relevant Pages

  • Re: Calc time difference between two date/time/zones
    ... between two date/time/zones as shown below. ... routine that can do this easily without having to manually convert ... You picked two "simple" time zones. ... make it very complicated when you're near a DST transition. ...
    (comp.lang.pascal.delphi.misc)
  • Re: Calc time difference between two date/time/zones
    ... between two date/time/zones as shown below. ... routine that can do this easily without having to manually convert ... You picked two "simple" time zones. ... library routine that does this? ...
    (comp.lang.pascal.delphi.misc)
  • YANFCQ [Yet Another Non-FastCode Question]: TDateTime -> uSec resolution
    ... A problem is that I cannot use DecodeTime() because it introduces rounding ... So I have written a routine that circumvents ... dividing out Int64 number of microseconds in the day, ... One thing I contemplated was a "DivSub" routine in ASM, ...
    (borland.public.delphi.language.basm)
  • Re: Calc time difference between two date/time/zones
    ... routine that can do this easily without having to manually convert ... You picked two "simple" time zones. ... library routine that does this? ... Will datediff not handle this directly? ...
    (comp.lang.pascal.delphi.misc)
  • Re: OT: What about NANs
    ... > Or you can call COT and examine the return value for Infs and NaNs. ... > decimation is done in the library routine, presumably having been coded by experts ...
    (comp.lang.fortran)