标签: linux date ubuntu command-line terminal
如何从ubuntu终端的日期获取工作日?
例如我输入:1990-01-22,我希望得到一个输出,例如Thursday if 22th day was a thursday。
1990-01-22
Thursday if 22th day was a thursday
答案 0 :(得分:5)
使用%A:
%A
$ date -d"1990-01-22" "+%A" Monday
来自man date:
man date
%A locale's full weekday name (e.g., Sunday)