Page 1 of 1

Yesterday

Posted: 23 Oct 2021 23:13
by drgt
I use this for "Today" timestamp:

Code: Select all

for /f %%i in ('WMIC OS Get LocalDateTime /value') do for /f %%j in ("%%i") do set "%%j"
set today=%LocalDateTime:~0,8%
Can I get "Yesterday" from this OR do I have to run the code mentioned in viewtopic.php?f=3&t=9254&p=60208&hilit= ... amp#p60208

Thanks

Re: Yesterday

Posted: 24 Oct 2021 04:12
by aGerman
Yes the :DaysAdd routine is able to calculate this for you. I'm not aware of any command that provides you yesterday's date out of the box. So we have no better possibility than adapting the formulas for Julian Day Numbers of the Gregorian Calendar.

Steffen

Re: Yesterday

Posted: 24 Oct 2021 22:10
by Aacini