.EXAMPLE.....: 52 Represent a date in a short (4-byte) format (technique #2)
.ALIAS.......: 52
.CATEGORY....: examples
.CODE........:
@echo off
cls
goto end-doc
------------------------------------------------------------------
This batch file shows how to use Fdate's #2XX function to
obtain and represent today's date in 4 characters, YYMD, where:
YY is the year (e.g. "93" for 1993)
M is the month in extended hexadecimal (XX) notation
D is the day-of-the-month in extended hexadecimal (XX) notation
You can also use Fdate's "XXX" output format to represent dates between
1990 and 2024 in 3 bytes of extended hex notation.
------------------------------------------------------------------
:end-doc
:: OBTAIN 1-CHARACTER REPRESENTATION FOR THE MONTH
Fdate /ff /Omm /Vmm
Fdate /f#2xx /A%mm% /Vmm
echo XX representation of this month's number is %mm%
:: OBTAIN 1-CHARACTER REPRESENTATION FOR THE DAY
Fdate /ff /Odd /Vdd
Fdate /f#2xx /A%dd% /Vdd
echo XX representation of today's day of the month is %dd%
:: CONCATENATE THEM TO THE 2-CHARACTER REPRESENTATION FOR THE YEAR
Fdate /Ff /Oyy /S%mm%%dd% /Vdate
echo XX representation of today's full date is %date%
:: CLEANUP
set mm=
set dd=
set date=
:endit