Date Math
Kenneth Brody
kenbrody at bestweb.net
Tue May 16 09:12:12 PDT 2006
Quoting Fairlight (Tue, 16 May 2006 11:39:22 -0400):
> At Tue, May 16, 2006 at 02:13:51PM +0000 or thereabouts,
> suspect William B. Eppler, Jr. was observed uttering:
> >
> > I need to go over several days. Not an easy feat as I am finding!!
>
> Here's my thinking on doing it:
>
[... snip long, complex logic ...]
>
> Okay, that's the complicated way of doing it, but I -think- it covers
> all the permutations. It's probably way more convoluted than necessary,
> but it's how I, personally, would approach the problem if doing it for
> myself and did not have access to a simple unix timestamp.
But, given that filePro already has date math and time math, all you
need to do is subtract the two dates, multiply by 24 (to get hours),
and add the difference of the times.
[...]
> PLUG FOR WISHLIST: UNIXTIME()
>
> If you had that, you just keep your format in unix timestamp form,
> subtract the two numbers, and do the appropriate divisions by 24, 60,
> and 60 to get your total elapsed time segments, bing, bang, boom--
> you're done. No worrying about meridians, as they become wholly
> irrelevant.
While there might be use for such a function, there is no need for it
here.
> One of those times fP coders get it rougher time of it than needs be.
> No pun actually intended, but I'll let it stand. :)
How "rough" is:
deltatime = (date2-date1)*"24" + (time2-time1)
as compared to:
deltatime = unixtime(date2,time2) - unixtime(date1,time1)
And would people on something other than "Unix" complain about
such a function name? :-)
--
KenBrody at BestWeb dot net spamtrap: <g8ymh8uf001 at sneakemail.com>
http://www.hvcomputer.com
http://www.fileProPlus.com
More information about the Filepro-list
mailing list