'OPTION _EXPLICIT
date1 = GetDate
date2 = GetDate
PRINT "The difference between "; date1$;
" and "; date2$;
" is ";
RTRIM$(LTRIM$(STR$(difference_of_days
(date1
, date2
))));
" days"
SHELL$
= "PowerShell -WindowStyle Hidden -ExecutionPolicy Bypass " + CHR$(34) + "&'" + _STARTDIR$ + "\GetNewDate.ps1';exit $LASTEXITCODE" + CHR$(34) month
= "0" + MID$(datepicked
, 1, 1) day
= MID$(datepicked
, 2, 2) year
= MID$(datepicked
, 4, 4) month
= MID$(datepicked
, 1, 2) day
= MID$(datepicked
, 3, 2) year
= MID$(datepicked
, 5, 4) GetDate = month + "-" + day + "-" + year
GetDate = ""
IF M
< 3 THEN M
= M
+ 12: Y
= Y
- 1 'add 12 to Jan - Feb month, -1 year C
= Y \
100: Y
= Y
MOD 100 'split century and year number S1 = (C \ 4) - (2 * C) - 1 'century leap
S2 = (5 * Y) \ 4 '4 year leap
S3 = 26 * (M + 1) \ 10 'days in months
WkDay
= (S1
+ S2
+ S3
+ D
) MOD 7 'weekday total remainder IF WkDay
< 0 THEN WkDay
= WkDay
+ 7 'Adjust negative results to 0 to 6 CASE 3: day
= "Wednesday" CASE 2: Moon
= "February" CASE 9: Moon
= "September" CASE 10: Moon
= "October" CASE 11: Moon
= "November" CASE 12: Moon
= "December" WeekDay$
= day
+ ", " + Moon
+ " " + ordinal_suffix_of
(LTRIM$(RTRIM$(STR$(D
)))) + ", " + MID$(formatteddate
, 7, 4)
ordinal_suffix_of = i + "st"
ordinal_suffix_of = i + "nd"
ordinal_suffix_of = i + "rd"
ordinal_suffix_of = i + "th"
check_leap_year = 1
check_leap_year = 0
IF month
= 1 OR month
= 3 OR month
= 5 OR month
= 7 OR month
= 8 OR month
= 10 OR month
= 12 THEN no_of_days_in_month = 31
no_of_days_in_month = 30
n = check_leap_year(year)
no_of_days_in_month = 29
no_of_days_in_month = 28
difference_of_days = 0
difference_of_days
= ABS(day1
- day2
) FOR i
= month1
TO month2
- 1 result = result + no_of_days_in_month(i, year1)
difference_of_days = result
result = result + (day2 - day1)
difference_of_days = result
result = result - (day1 - day2)
difference_of_days = result
result = 0
FOR i
= month2
TO month1
- 1 result = result + no_of_days_in_month(i, year1)
difference_of_days = result
result = result + (day1 - day2)
difference_of_days = result
result = result - (day2 = day1)
difference_of_days = result
FOR i
= year1
TO year2
- 1 IF check_leap_year
(i
) = 1 THEN temp = temp + 366
temp = temp + 365
difference_of_days = temp
difference_of_days = temp + (day2 - day1)
difference_of_days = temp - (day1 - day2)
result = 0
FOR i
= month1
TO month2
- 1 result = result + no_of_days_in_month(i, year2)
difference_of_days = temp + result
result = result + (day2 - day1)
difference_of_days = temp + result
result = result - (day1 - day2)
difference_of_days = temp + result
result = 0
FOR i
= month2
TO month1
- 1 result = result + no_of_days_in_month(i, year2)
difference_of_days = temp - result
result = result + (day1 - day2)
difference_of_days = temp - result
result = result - (day2 - day1)
difference_of_days = temp - result
temp = 0
FOR i
= year2
TO year1
- 1 IF check_leap_year
(i
) = 1 THEN temp = temp + 366
temp = temp + 365
difference_of_days = temp
difference_of_days = temp + (day1 - day2)
difference_of_days = temp - (day2 - day1)
result = 0
FOR i
= month2
TO month1
- 1 result = result + no_of_days_in_month(i, year1)
difference_of_days = temp + result
result = result + (day1 - day2)
difference_of_days = temp + result
result = result - (day2 - day1)
difference_of_days = temp + result
result = 0
FOR i
= month1
TO month2
- 1 result = result + no_of_days_in_month(i, year1)
difference_of_days = temp - result
result = result + (day2 - day1)
difference_of_days = temp - result
result = result - (day1 - day2)
difference_of_days = temp - result