Here's a library function that uses the script command, the tcommand() interface, and VBScript, to determine the number of years (full and part) given a date by the user;
Read more
Code:
DateDiff {
@setlocal
@echo off
set dest=%temp\vb.vbs
set theDate=%1
if defined theDate (
::NEXT SENTENCE
) else (
set theDate=%_isodate
)
>%dest echo TakeCommand.tcommand("echo " + CStr(DateDiff("d", "%theDate", Now) / 365.25))
set _DateDiff=%@execstr[script %dest]
echo %_DateDiff
endlocal _DateDiff...
Read more