Command Prompt for Windows




DATE2SER Example

Consider the following batch file :-

@ECHO OFF
GETSTR Enter your date of birth ?
DATE2SER %getstr%
SET dob=%date2ser%
DATE2SER %date_today%
CALC %date2ser% - %dob%
ECHO.
ECHO You have been alive for %calc% days.

This batch file demonstrates the use of command DATE2SER to perform arithmetic calculations on dates and simply displays the number of days you have been alive.