How I can check the date using a calender , what I want to do is that a user insert a date in this way 2012/07/15 , and i want to check if this date exist in the calender .
for example if he insert 2012/14/13 or even 2012/02/31 , i tried to do that manually but its really hard , so my qustions are :
-
is there a native function(or even 3d party tools) to check date in calender ?
-
if the user insert date and hour , I want to give same result with different time zone places ?
The subroutine below is comprised of two parts. First it check the date given in 1st parameter and return ERRORLEVEL=1 if the date is bad. You may insert a year valid range if you wish (otherwise, remove the yyOK parts).
Then it takes a base hour and time-zone adjust in 2nd and 3rd parameters and show the adjusted date.
Test this program and report any problem.
EDIT: I have modified previous program to fit new OP’s requirements.
The subroutine no longer returns an ERRORLEVEL value with the result. It must be called now with a new first parameter that indicate the variable that will receive the result, that will be “Invalid date” if original date is bad. If a base and adjustment hours are given, returned value include the adjusted date and hour. For example:
Antonio