## Date Math

Expand Messages
• Does anyone already have functions to calculate a date N number of days in the past or future? Or Calculate the number of days between two dates?
Message 1 of 8 , Jun 4 3:32 PM
Does anyone already have functions to calculate a date N number of
days in the past or future?

Or Calculate the number of days between two dates?
• ... If you haven t found your answer yet, you can manipulate the time and date using the combination of a free command line utility program called TimeMath.exe
Message 2 of 8 , Jun 5 10:40 AM
--- In ntb-clips@yahoogroups.com, "Walter" <wwabbott@m...> wrote:
> Does anyone already have functions to calculate a date N number of
> days in the past or future?
>
> Or Calculate the number of days between two dates?

If you haven't found your answer yet, you can manipulate the time and
date using the combination of a free command line utility program
called TimeMath.exe and a clip. The zipped file containing
TimeMath.exe can be downloaded from: (it's a long URL, so watch out
for yahoo inserted line breaks)

http://gearbox.maem.umr.edu/batch/f_w_util/Frank_Westlake-
Freeware.html

Unzip TimeMath (the zipped file includes a help file) and put it
where you want it to be. In my clip example below I have it stored as
C:\bin\TimeMath.exe

Then with a clip similar to the one below, you can calculate dates
and times in numerous ways. This sample clip tells TimeMath to
calculate the DATE/TIME/DAY OF WEEK of one week ago today. The
results are first sent to a temp file which NoteTab reads and
displays in a NoteTab ^!Info box.

From that point using other clip commands you could parse the
returned dates/times however you want to.

John

; Begin Clip ====================================

; run timemath and send date parms to it
; timemath output will be sent to a temp
; file named: c:\timemath.txt

^!DOS "C:\bin\TimeMath.exe" week-1 >c:\timemath.txt

; force notetab to wait till above is done
^!Wait

; open the file
^!Open "c:\timemath.txt"

; set var %results% to all text in file
^!Set %RESULTS%=^\$GetText\$

; show date and time results in a NoteTab ^!Info box
^!Info ^%RESULTS%

; End Clip ======================================
• ... (...) ... (...) I guess, you could just: ^!set %results%=^\$getdosoutput( C: bin TimeMath.exe week-1 )\$ .. so you wouldn t need a temp file. ... Another
Message 3 of 8 , Jun 5 2:13 PM
----- on 05.06.2004 19:40 John Zeman wrote:
(...)
> ; run timemath and send date parms to it
> ; timemath output will be sent to a temp
> ; file named: c:\timemath.txt
> ^!DOS "C:\bin\TimeMath.exe" week-1 >c:\timemath.txt
(...)

I guess, you could just:

^!set %results%=^\$getdosoutput("C:\bin\TimeMath.exe" week-1")\$

.. so you wouldn't need a temp file.

---

Another interesting command line tool
for time calculations is Fdate91c

Freeware from
<http://www.simtel.net/product.php%5Bid%5D40615%5Bsekid%5D0%5BSiteID%5Dsimtel.net%5BSiteID%5Dsimtel.net>

Regards,
Melchior

--
http://loc.alphazwirbel.net
http://orp.alphazwirbel.net
• ... 5BSiteID%5Dsimtel.net%5BSiteID%5Dsimtel.net ... True enough melchior. I have to admit that I run all my command line utilities from actual command line
Message 4 of 8 , Jun 5 4:23 PM
--- In ntb-clips@yahoogroups.com, melchior prisi <mprisi@s...> wrote:
> ----- on 05.06.2004 19:40 John Zeman wrote:
> (...)
> > ; run timemath and send date parms to it
> > ; timemath output will be sent to a temp
> > ; file named: c:\timemath.txt
> > ^!DOS "C:\bin\TimeMath.exe" week-1 >c:\timemath.txt
> (...)
>
> I guess, you could just:
>
> ^!set %results%=^\$getdosoutput("C:\bin\TimeMath.exe" week-1")\$
>
> .. so you wouldn't need a temp file.
>
> ---
>
> Another interesting command line tool
> for time calculations is Fdate91c
>
> Freeware from
> <http://www.simtel.net/product.php%5Bid%5D40615%5Bsekid%5D0%
5BSiteID%5Dsimtel.net%5BSiteID%5Dsimtel.net>
>
>
> Regards,
> Melchior
>

True enough melchior.

I have to admit that I run all my command line utilities from actual
command line scripts. I'd forgotten about ^\$getdosoutput\$ and how
NoteTab can import command line results.

By the way, when I went to the link you posted it returned a page not
found error.

John
• ... not ... Never mind, it works now. http://www.simtel.net/pub/pd/40615.html John
Message 5 of 8 , Jun 5 4:54 PM
> By the way, when I went to the link you posted it returned a page
not
> found error.
>
> John

Never mind, it works now.

http://www.simtel.net/pub/pd/40615.html

John
• Hi John ... Here is another Link that should work: http://www.bookcase.com/library/software/msdos.util.batch.html fdate91c.zip is about in the middle down the
Message 6 of 8 , Jun 5 5:02 PM
Hi John
----- on 06.06.2004 01:23 John Zeman wrote:
> By the way, when I went to the link you posted it returned a page not
> found error.

Here is another Link that should work:
http://www.bookcase.com/library/software/msdos.util.batch.html

fdate91c.zip is about in the middle down the page..

Regards,
Melchior

--
http://loc.alphazwirbel.net
http://orp.alphazwirbel.net
• I downloaded TimeMath but it only had the Timemath.exe and no help file. Does anyone have the help file? Thanks, Roy ... From: melchior prisi
Message 7 of 8 , Jun 8 12:48 PM
Does anyone have the help file?
Thanks,
Roy

----- Original Message -----
From: "melchior prisi" <mprisi@...>
To: <ntb-clips@yahoogroups.com>
Sent: Saturday, June 05, 2004 7:02 PM
Subject: Re: [Clip] Re: Date Math

> Hi John
> ----- on 06.06.2004 01:23 John Zeman wrote:
> > By the way, when I went to the link you posted it returned a page not
> > found error.
>
> Here is another Link that should work:
> http://www.bookcase.com/library/software/msdos.util.batch.html
>
> fdate91c.zip is about in the middle down the page..
>
>
> Regards,
> Melchior
>
>
> --
> http://loc.alphazwirbel.net
> http://orp.alphazwirbel.net
>
>
>
>
>
>
>
>
>
• ... file. ... Like many command line programs, the help is built into the program. You can get it by going to a command prompt (a DOS prompt) in the directory
Message 8 of 8 , Jun 8 1:09 PM
--- In ntb-clips@yahoogroups.com, "Roy Herring" <roynancy@e...> wrote:
file.
> Does anyone have the help file?
> Thanks,
> Roy

Like many command line programs, the help is built into the program.
You can get it by going to a command prompt (a DOS prompt) in the
directory the timemath program is stored in, and typing one of the
following:

To just see the help type:
Timemath /?

To output the help to a text file:
Timemath /? > timemath.txt

Then press ENTER after either of the above lines.

John
Your message has been successfully submitted and would be delivered to recipients shortly.