Window 批处理(BAT)中生成格式化日期时间字符串

今天打算写一些脚本同时支持 Windows 和 Linux,因此需要同一个脚本需要写一个 shell 版本和一个 bat 版本。其中一项需求是要生成一个日志文件,文件后缀是当前系统时间的字符串’yyymmddMMHHSS’这种格式的,所以需要取到当前时间并格式化。在 Linux 中,这是一个很简单的需求,直接使用 date +'%y%m%d%H%M%S' 就可以拿到,但是在 Windows 中就非常麻烦了。

Continue reading
  • Page 1 of 1

Samuel Chen

I am living in Wuhan with my wife and daughter.
Before 2010, I was living in Beijing for a long time.
My interesings are cloud technology, distributed system, data mining and mobile technologies.
In my spare time, I like to play football and swiming.
“Explorer. Dream. Discover. “ is my favorite quotation. And it is also the way I am looking for and doing.


Wuhan, China