Linux date +%H%M%S与date +%H%m%S的区别

Linux date +%H%M%S与date +%H%m%S
M与m大小写的区别:M是min分钟,m是month月份。前者执行是正常的’时分秒’,后者打印出来是’时月秒’,而’月份’不变,短时间内’’不变,'秒’在0-59之间循环,所以date +%H%m%S看上去就好像在一分钟之内循环一样。

打印date +%H%M%S的正常结果:

[zhouchen@hadoop102 tmp]$ echo `date +%H%M%S`
130954
[zhouchen@hadoop102 tmp]$ echo `date +%H%M%S`
130955
[zhouchen@hadoop102 tmp]$ echo `date +%H%M%S`
130956
[zhouchen@hadoop102 tmp]$ echo `date +%H%M%S`
130957
[zhouchen@hadoop102 tmp]$ echo `date +%H%M%S`
130958
[zhouchen@hadoop102 tmp]$ echo `date +%H%M%S`
130959
[zhouchen@hadoop102 tmp]$ echo `date +%H%M%S`
131000
[zhouchen@hadoop102 tmp]$ echo `date +%H%M%S`
131001
[zhouchen@hadoop102 tmp]$ echo `date +%H%M%S`
131002

打印date +%H%m%S的结果:

[zhouchen@hadoop102 tmp]$ echo `date +%H%m%S`
130954
[zhouchen@hadoop102 tmp]$ echo `date +%H%m%S`
130955
[zhouchen@hadoop102 tmp]$ echo `date +%H%m%S`
130956
[zhouchen@hadoop102 tmp]$ echo `date +%H%m%S`
130957
[zhouchen@hadoop102 tmp]$ echo `date +%H%m%S`
130958
[zhouchen@hadoop102 tmp]$ echo `date +%H%m%S`
130959
[zhouchen@hadoop102 tmp]$ echo `date +%H%m%S`
130900
[zhouchen@hadoop102 tmp]$ echo `date +%H%m%S`
130901
[zhouchen@hadoop102 tmp]$ echo `date +%H%m%S`
130902

你可能感兴趣的:(Linux,linux)