Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Batch file 批处理如何打印日期时间_Batch File_Time - Fatal编程技术网

Batch file 批处理如何打印日期时间

Batch file 批处理如何打印日期时间,batch-file,time,Batch File,Time,我有一个批处理语法打印日期时间。给你 echo mydateTime_%date:~-4,4%_%date:~-7,2%d_%date:~-10,2%m_%time:~0,2%hr-%time:~3,2%min-%time:~6,2%sec 我要它回来 mydateTime_2015_22d_04m_9hr-41min-06sec 但它正在回归 mydateTime_2015_22d_04m_ 9hr-41min-06sec 04m_u9hr之间的间距。我不明白为什么会产生空间 set "

我有一个批处理语法打印日期时间。给你

echo mydateTime_%date:~-4,4%_%date:~-7,2%d_%date:~-10,2%m_%time:~0,2%hr-%time:~3,2%min-%time:~6,2%sec
我要它回来

mydateTime_2015_22d_04m_9hr-41min-06sec
但它正在回归

mydateTime_2015_22d_04m_ 9hr-41min-06sec
04m_u9hr
之间的间距。我不明白为什么会产生空间

set "dt=mydateTime_%date:~-4,4%_%date:~-7,2%d_%date:~-10,2%m_%time:~0,2%hr-%time:~3,2%min-%time:~6,2%sec"
echo %dt: =%
试试这个

也检查

试试这个

也检查

试试这个

也检查

试试这个

也检查