home bbs files messages ]

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

   alt.msdos.batch.nt      Fun with Windows NT batch files      68,980 messages   

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

   Message 67,717 of 68,980   
   Fin Tres Nueve Dos to All   
   Re: Setting System Time N Hours Back   
   24 Jan 21 11:13:40   
   
   From: fin392@gmail.com   
      
   El domingo, 24 de enero de 2021 a las 13:23:17 UTC+1, JJ escribió:   
   > On Sat, 23 Jan 2021 12:17:28 -0500, Saucer Man wrote:    
   > > I'm looking to set the system time back a certain number of hours.    
   > > Would anyone know how to do that in a batch file?   
   > Yes, but it'll depend on your date and time format.   
      
   Check this. It is not depending on date and time format   
      
   :: Example of using the function   
   @ECHO OFF & SETLOCAL   
      
   	CALL :GetLocalDateTime CurrentTime   
      
   	ECHO Current date and time is [%CurrentTime%]   
      
   ENDLOCAL & EXIT /B 0   
      
      
   :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::   
   ::   
   :: Return local date and time with format 'yyyymmddhhmmss.ffffff+mmm'.   
   ::   
   :: Rear '+mmm' is the UTC time offsets in minutes.   
   ::   
   :GetLocalDateTime {Return_variable}   
      
   	FOR /F "tokens=1* delims==" %%a IN ('wmic OS GET LocalDateTime /VALUE ^| find   
   "="') DO SET "%~1=%%b"   
      
   EXIT /B 0   
   :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::   
      
   --- 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