Green Light Coding presents a new project which show how to evaluate Days of any Dates without Calendar using Batch Script Command Line.
You can find the day of any date through this technique even if it is not in your calendar that is you can find 24/02/2037 is TUESDAY without checking calendar but only with a simple formulae given below with the code.
So try the code and , go for it .
2000 calendar
batch script
leap year
day finder
_____________________________________________________________
Stay connected to us for more necessary coding tricks like these.
_____________________________________________________________
#coding
#calendar
#days
#mathematics
#probability
#highlight
#highlighter
#graphics
#graphicdesign
#editingapps
#editor
#editingtutorial
#editing
#applications
#file
#edits
#coding
#icon
#cmd
#code
#batchfile
#learning
#info
#simple
#functions
#notepads
#console
#programming
#programminglife
#coder
#programmers
#important
#brightness
#updates
code:
::century code of 2000 is 6 and that of 1900 is 4 (it has a cyclic order for 6,4,2,0,6,4,2,0,...and so on)
::copy the code and paste it to notepad and save it with .bat extension
@echo off
echo DAYS OF THE 2000 S REPRESENTS THE DATES OF ALL 1000 YEARS IN 2000 CENTURY :
:l
title = DAYS OF THE 2000 S %date% %time% (Last Updated time)
color b0
echo PROVIDE THE DATE TO GET THE DAY (2000 onwards)-
echo.
::set da = %date%
::echo %da%
set /p d=DATE (DD) :
set /p m=DATE (MM) :
set /p y=DATE (YYYY) :
if %m% == 1 (set /a mn = 1)
if %m% == 2 (set /a mn = 4)
if %m% == 3 (set /a mn = 4)
if %m% == 4 (set /a mn = 0)
if %m% == 5 (set /a mn = 2)
if %m% == 6 (set /a mn = 5)
if %m% == 7 (set /a mn = 0)
if %m% == 8 (set /a mn = 3)
if %m% == 9 (set /a mn = 6)
if %m% == 10 (set /a mn = 1)
if %m% == 11 (set /a mn = 4)
if %m% == 12 (set /a mn = 6)
::set /a ly = ((%y%) - 2000) / 4
set /a yr = %y% -2000
set /a py = %yr% -1
set /a ply = %py% / 4
set /a ly = %yr% / 4
set /a nday = (%d% +6 + %ly% + %mn% + %yr% )
set /a pnday = (%d% +6 + %ply% + %mn% + %yr% )
set /a dnday= (%nday% - %pnday%)
if %dnday% == 0 (goto nd) else (goto pnd)
::set /a dayn =%nday%- ((%nday% / 7) *7)
::set /a yrp=%ply%
::set /a yrm=%ly%
echo.
goto l
:nd
cls
echo.
echo LeapYear : no
echo.
set /a dayn =%nday%- ((%nday% / 7) *7)
if %dayn% == 1 (echo %d% . %m% . %y% is SUNDAY)
if %dayn% == 2 (echo %d% . %m% . %y% is MONDAY)
if %dayn% == 3 (echo %d% . %m% . %y% is TUESDAY)
if %dayn% == 4 (echo %d% . %m% . %y% is WEDNESDAY)
if %dayn% == 5 (echo %d% . %m% . %y% is THURSDAY)
if %dayn% == 6 (echo %d% . %m% . %y% is FRIDAY)
if %dayn% == 0 (echo %d% . %m% . %y% is SATURDAY)
if %y% leq 1999 (cls) & (echo Error 39: CANNOT CALCULATE DATES BEFORE 2000)
if %y% geq 3000 (cls) & (echo Error 57: WARNING !INCORRECTLY UPDATED CENTURY CODE)
if %m% geq 13 (cls) & (echo Error 15: number of month can not exceed 12)
if %d% geq 32 (cls) & (echo Error 11: number of day of any date cannot exceed 31)
if %d% leq 0 (cls) & (echo Error 18: number of day of any date cannot be 0 or less than 0)
if %m% leq 0 (cls) & (echo Error 187: number of month of any date cannot be 0 or less than 0)
if %y% leq 0 (cls) & (echo Error 189: number of year of any date cannot be 0 or less than 0)
echo.
goto l
:pnd
cls
echo.
echo LeapYear : yes
echo.
set /a dayn =%pnday%- ((%pnday% / 7) *7)
if %dayn% == 1 (echo %d% . %m% . %y% is SUNDAY)
if %dayn% == 2 (echo %d% . %m% . %y% is MONDAY)
if %dayn% == 3 (echo %d% . %m% . %y% is TUESDAY)
if %dayn% == 4 (echo %d% . %m% . %y% is WEDNESDAY)
if %dayn% == 5 (echo %d% . %m% . %y% is THURSDAY)
if %dayn% == 6 (echo %d% . %m% . %y% is FRIDAY)
if %dayn% == 0 (echo %d% . %m% . %y% is SATURDAY)
if %y% leq 1999 (cls) & (echo Error 39: CANNOT CALCULATE DATES BEFORE 2000)
if %y% geq 3000 (cls) & (echo Error 27: WARNING !INCORRECTLY UPDATED CENTURY CODE)
if %m% geq 13 (cls) & (echo Error 15: number of month can not exceed 12)
if %d% geq 32 (cls) & (echo Error 11: number of day of any date cannot exceed 31)
if %d% leq 0 (cls) & (echo Error 18: number of day of any date cannot be 0 or less than 0)
if %m% leq 0 (cls) & (echo Error 181: number of month of any date cannot be 0 or less than 0)
if %y% leq 0 (cls) & (echo Error 189: number of year of any date cannot be 0 or less than 0)
echo.
goto l
SUBSCRIBE FOR MORE UPDATES LIKE THESE
_______________________________________________________________
CHANNEL LINK : [ Ссылка ]
_______________________________________________________________
Ещё видео!