How can I change the format of a date from the command line?

后端 未结 6 1563
梦毁少年i
梦毁少年i 2020-12-19 17:04

What\'s the quickest way to convert a date in one format, say

2008-06-01

to a date in another format, say

6条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-19 17:45

    date -d yyyy-mm-dd
    

    If you want more control over formatting, you can also add it like this:

    date -d yyyy-mm-dd +%a
    

    to just get the Sun part that you say you want.

提交回复
热议问题