Topic: Calculate days between dates submacro (1 of 5), Read 16 times, 1 File Attachment
Conf: VEDIT Macro Library
From: Scott Lambert
Date: Friday, June 04, 2010 05:50 PM

Daysdate.vdm is a submacro that calculates the days between 2 dates. Return_value is set to
the number of days.

Needs access my leapyear.vdm submacro, which I have also posted.

Scott

 
DAYSDATE.VDM (1KB)

 


Topic: Calculate days between dates submacro (2 of 5), Read 20 times
Conf: VEDIT Macro Library
From: Ian Binnie
Date: Friday, June 04, 2010 09:23 PM

On 6/4/2010 5:50:07 PM, Scott Lambert wrote:
>Daysdate.vdm is a submacro
>that calculates the days
>between 2 dates. Return_value
>is set to
>the number of days.
>
>Needs access my leapyear.vdm
>submacro, which I have also
>posted.
>
>Scott

Many years (actually decades) ago I wrote my own date library in c, however in vedit I just use the inbuilt Num_Eval_Date( )

 


Topic: Calculate days between dates submacro (3 of 5), Read 24 times
Conf: VEDIT Macro Library
From: Scott Lambert
Date: Saturday, June 05, 2010 01:17 PM

>Many years (actually decades) ago I
>wrote my own date library in c, however
>in vedit I just use the inbuilt
>Num_Eval_Date( )
>

I re-invented the wheel, it appears. Oh well, it was a fun macro to write.

Scott

 


Topic: Calculate days between dates submacro (4 of 5), Read 25 times
Conf: VEDIT Macro Library
From: Ted Green
Date: Saturday, June 05, 2010 02:31 PM

On 6/4/2010 5:50:07 PM, Scott Lambert wrote:
>Daysdate.vdm is a submacro
>that calculates the days
>between 2 dates. Return_value
>is set to the number of days.

I am not sure it is documented, but this command in VEDIT might help:

; JDate() - Return quasi Julian date for current date.
; JDate(date) - date = "mm.dd.yyyy".
; JDate(date,BEGIN) - date = "dd.mm.yyyy".
; JDate(date,REVERSE) - date = "yyyy.mm.dd".
; Accept any unique separator.
; Set Chars_Matched (0 for JDate and JDate()).

You can then insert a date with the Num_Ins_Date() command.
Therefore these commands:

#1 = jdate("01/01/1979")
num_ins_date(#1)

Will insert "01/01/1979" into the buffer.

This would calculate the number of days between two dates:

jdate("06/05/10") - jdate("01/01/1979")

BTW - I just noticed that my email replies to WebBoard are not working. Is anyone else having this problem?

 


Topic: Calculate days between dates submacro (5 of 5), Read 30 times
Conf: VEDIT Macro Library
From: Peter Rejto
Date: Sunday, June 06, 2010 02:20 AM

On 6/5/2010 2:31:04 PM, Ted Green wrote:
>On 6/4/2010 5:50:07 PM, Scott Lambert
>wrote:
>>Daysdate.vdm is a submacro
>>that calculates the days
>>between 2 dates. Return_value
>>is set to the number of days.
>
>I am not sure it is documented, but this
>command in VEDIT might help:
>
>; JDate() - Return quasi Julian date for
>current date.
>; JDate(date) - date =
>"mm.dd.yyyy".
>; JDate(date,BEGIN) - date =
>"dd.mm.yyyy".
>; JDate(date,REVERSE) - date =
>"yyyy.mm.dd".
>; Accept any unique separator.
>; Set Chars_Matched (0 for JDate and
>JDate()).
>
>You can then insert a date with the
>Num_Ins_Date() command.
>Therefore these commands:
>
>#1 = jdate("01/01/1979")
>num_ins_date(#1)
>
>Will insert "01/01/1979" into the
>buffer.
>
>This would calculate the number of days
>between two dates:
>
>jdate("06/05/10") - jdate("01/01/1979")
>
>BTW - I just noticed that my email
>replies to WebBoard are not working. Is
>anyone else having this problem?


Thanks Ted for the Julian Calendar tutorial.

Yes I am also having intermittant problems with the WebBoard. So far, I have been unable to isolate it.


-peter