Format date and time consistently. (#1580)

* Format date and time consistently.

Co-authored-by: junos <junos.lukan@ijs.si>
Co-authored-by: earthlng <earthlng@users.noreply.github.com>
This commit is contained in:
junoslukan 2022-11-13 14:37:26 +00:00 committed by GitHub
parent a93047e6c9
commit 365e76bc9f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 8 deletions

View file

@ -3,10 +3,10 @@ TITLE arkenfox user.js updater
REM ## arkenfox user.js updater for Windows
REM ## author: @claustromaniac
REM ## version: 4.16
REM ## version: 4.17
REM ## instructions: https://github.com/arkenfox/user.js/wiki/5.1-Updater-[Options]#-windows
SET v=4.15
SET v=4.17
VERIFY ON
CD /D "%~dp0"
@ -177,8 +177,9 @@ IF EXIST user.js.new (
IF DEFINED _singlebackup (
MOVE /Y user.js user.js.bak >nul
) ELSE (
SET "_time=!time: =0!"
MOVE /Y user.js "user-backup-!date:/=-!_!_time::=.!.js" >nul
FOR /F "usebackq tokens=1,2 delims==" %%i IN (`wmic os get LocalDateTime /VALUE 2^>NUL`) DO IF '.%%i.'=='.LocalDateTime.' SET ldt=%%j
SET ldt=%ldt:~0,8%_%ldt:~8,6%
MOVE /Y user.js "user-backup-%ldt%.js" >nul
)
REN user.js.new user.js
CALL :message "Update complete."