我需要获取Unix时代以来的当前时间戳(单位为毫秒)。
我得到了
WScript.Echo DateDiff("s", "01/01/1970 00:00:00", Now())从这个问题的答案:
Is there a way to get epoch time using a Windows command?
但是它不支持对第一个参数使用"ms"。
有没有办法以毫秒为单位获取上面提到的时间戳,使用CScript或任何其他可从.bat运行或作为CScript运行的方法?
发布于 2013-05-20 21:49:17
C:\>for /f "tokens=1,2 delims=.," %a in ('powershell Get-Date -UFormat %s') do echo %a%b如果您打算在批处理脚本中使用它,则需要双倍%
或
C:\>powershell [float](Get-Date -UFormat %s)*1000https://stackoverflow.com/questions/16648093
复制相似问题