简体   繁体   English

更改日期外壳的格式

[英]changing format of date shell

I want to change date format of last reboot time. 我想更改上次重启时间的日期格式。 How can I do this? 我怎样才能做到这一点? Any idea ? 任何想法 ? I cut the other things from last reboot command. 我从上次重启命令中删除了其他内容。 The last seems : 最后似乎:

Output :  1 Nov 2015

But I want like this : 但我想要这样:

dd/mm/yyyy : 01/11/2015

Since you already cut the output you just have to convert it to different format, try below you will find your expected format. 由于您已经剪切了输出,只需要将其转换为其他格式,请尝试以下操作,以找到所需的格式。

export DATE="1 Nov 2015"
date -d"$DATE" +%d/%m/%Y
01/11/2015

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM