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

前端 未结 3 1798
独厮守ぢ
独厮守ぢ 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:24

    This is what finally worked on unix(solaris).

    date '+%d-%h-%Y' | tr [:lower:] [:upper:]
    

    returned: 04-NOV-2009

提交回复
热议问题