Batch: Timestamp to UNIX Time

前端 未结 5 744
感情败类
感情败类 2020-12-16 16:44

For all I know, Batch does not have a command that gives the UNIX time. The closest one I can find is %time%, which only displays the timestamp.

Is ther

5条回答
  •  不知归路
    2020-12-16 17:27

    create a .bat file called "getUtime.bat"

    @echo off
    echo WScript.Echo(new Date().getTime()); > %temp%\time.js
    cscript //nologo %temp%\time.js
    del %temp%\time.js
    

    and call like this

    "C:\>getUTime"
    1430894237616
    

提交回复
热议问题