How to format the date in KornShell script to DD-MON-YYYY?

前端 未结 3 1797
独厮守ぢ
独厮守ぢ 2021-01-19 12:32

How do I format a date in a KornShell (ksh) script to DD-MON-YYYY?

I have tried the following:

date \'+%d-%h-%Y\'

It returns

3条回答
  •  星月不相逢
    2021-01-19 13:14

    You could uppercase it yourself if caret uppercase is not supported in your environment:

    date '+%d-%h-%Y' | tr 'a-z' 'A-Z'
    

提交回复
热议问题