Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for easter_php.bat

(view source code of easter_php.bat as plain text)

  1. @ECHO OFF
  2. IF "%~1"=="" (
  3. 	PHP.EXE -r "print(date('l, j F Y',easter_date()));"
  4. ) ELSE (
  5. 	ECHO.%*| FINDSTR /R /X /C:"[12][0-9][0-9][0-9]" >NUL
  6. 	IF ERRORLEVEL 1 GOTO Syntax
  7. 	IF %~10 LSS 19700 GOTO Syntax
  8. 	IF %~10 GTR 20370 GOTO Syntax
  9. 	PHP.EXE -r "print(date('l, j F Y',easter_date('%~1')));"
  10. )
  11.  
  12. GOTO:EOF
  13.  
  14. :Syntax
  15. ECHO.
  16. ECHO EasterPHP.bat,  Version 1.01
  17. ECHO Use PHP to display the Easter date for the specified year
  18. ECHO.
  19. ECHO Usage:  EASTERPHP  [ year ]
  20. ECHO.
  21. ECHO Where:  "year"   is a year in the range 1970..2037
  22. ECHO                  (default: current year)
  23. ECHO.
  24. ECHO Written by Rob van der Woude
  25. ECHO http://www.robvanderwoude.com
  26. EXIT /B 1
  27.  

page last uploaded: 2017-04-06, 13:33