1.例子

echo %time:~0,-1% 

显示时间字符,从第0个到最后一个

C:\Documents and Settings>echo %time:~0,-1%
19:00:22.3

C:\Documents and Settings>echo %time%
19:00:29.49


C:\Documents and Settings>echo %date:~2,-1%
12-09-27 星期

C:\Documents and Settings>echo %date:~,3%  //第2个参数为正则表示显示的个数,为负则表示显示字符的终点下标
201

C:\Documents and Settings>echo %date:~1,3%
012

 

2.other

set str=i love you

C:\Documents and Settings>echo %str:~3%
ove you

C:\Documents and Settings>echo %str:~,-1%
i love yo

 

相关文章:

  • 2021-12-22
  • 2021-12-13
  • 2022-01-11
  • 2022-01-26
  • 2022-02-03
  • 2021-11-22
猜你喜欢
  • 2021-10-07
  • 2022-12-23
  • 2022-12-23
  • 2021-10-11
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案