how to print previous date

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
!k
Expert
Posts: 378
Joined: 17 Oct 2009 08:30
Location: Russia

Re: how to print previous date

#16 Post by !k » 10 Aug 2010 13:09

On Russian XP
Image

Code: Select all

Z:\4\2>date
Текущая дата: 10.08.2010
Введите новую дату (дд-мм-гг):

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: how to print previous date

#17 Post by aGerman » 10 Aug 2010 16:04

You will find a lot of informations into the registry.
HKEY_CURRENT_USER\Control Panel\International
Mostly the format is like in sShortDate. Sometimes the day of week is prepended, but it's simple to find out.

Regards
aGerman

!k
Expert
Posts: 378
Joined: 17 Oct 2009 08:30
Location: Russia

Method to determine the day-month-year on any language

#18 Post by !k » 27 Aug 2010 16:20

Method to determine the day-month-year-day of the week on any 2000/XP/2003 with any regional settings on any language version of the OS.

Code: Select all

@echo off
echo.>"%TEMP%\~.ddf"
makecab /D RptFileName="%TEMP%\~.rpt" /D InfFileName="%TEMP%\~.inf" -f "%TEMP%\~.ddf">nul
for /f "tokens=4,5,7" %%a in ('type "%TEMP%\~.rpt"') do if not defined current-date set "current-date=%%c-%%a-%%b"
echo %current-date%
del /q "%TEMP%\~.*"
pause

Who has the opportunity, please check on Vista/7.

Post Reply