有没有办法使用Windows命令获取时代? [英] Is there a way to get epoch time using a Windows command?
本文介绍了有没有办法使用Windows命令获取时代?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法使用Windows命令获取时代?如果没有,可以修改 date
和时间
命令输出吗?
例如, date
在Windows中给出带有/等的日期。我想获得一个没有特殊字符的输出,例如/:
解决方案
要获得yyyymmdd格式的时间,请尝试:
for / Ftokens = 2-4 delims = /%i in('date / t')do echo%k%i%j
/ pre>
更多:
http://www.sprint.net.au/~terbut/usefulbox/msdoscmds.htm
Is there a way to get epoch time using a Windows command? If not, can the
date
andtime
commands output be modified?For example
date
in Windows gives the date with / etc. I would like to get an output that has no special characters such as / :解决方案To get time in the "yyyymmdd" format, try this:
for /F "tokens=2-4 delims=/ " %i in ('date /t') do echo %k%i%j
More on:
http://www.sprint.net.au/~terbut/usefulbox/msdoscmds.htm
这篇关于有没有办法使用Windows命令获取时代?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文