批处理获取当前时间

发布日期:
set currentDate=%date:/=_%
set currentDate=%currentDate:~0,10%

set currentTime=%time:~0,5%
set currentTime=%currentTime: =0%
set currentTime=%currentDate%_%currentTime::=%

echo %currentTime%
# 2020_08_03_1630

批处理不能在一行内对字符串作出多个操作,所以不能又替换又截取