home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch      Fun with MS-DOS batch files      42,547 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 41,989 of 42,547   
   JJ to Herbert Kleebauer   
   Re: DOS Batch program countdown days unt   
   04 Feb 22 16:45:30   
   
   From: jj4public@gmail.com   
      
   On Thu, 3 Feb 2022 11:35:02 +0100, Herbert Kleebauer wrote:   
   > On 03.02.2022 10:05, JJ wrote:   
   >   
   >>>:: extract the variables %y% %m% %d% from the %date% variable   
   >>>:: (this depends on the local date format)   
   >> [snip]   
   >>   
   >> And to detect the current date format, it can be done like below (warning:   
   >> long text).   
   >   
   >> for /f "delims=" %%A in ('2^>nul wmic   
   >   
   > If you use wmic anyhow, you can also use it to directly   
   > get the date:   
   >   
   > @echo off   
   > for /f "tokens=*" %%i in ('wmic os get LocalDateTime /value^|find  "l"') do   
   set %%i   
   > echo  year=%localdatetime:~0,4%   
   > echo month=%localdatetime:~4,2%   
   > echo   day=%localdatetime:~6,2%   
      
   Good thinking.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca