How to display date in DD-MMM-YYYY format

1 View
Reply
L
Legacy User 1
8/1/2019, 5:39:13 AM

I want to show unix date in DD-MMM-YYYY format. Month field should be in three letter capital alphapet and date and year in numerical.

example: 22-OCT-2015

I tried the below shell code but it shows in small letters. Can anyone help me to get this work?

$ date ‘+%d-%h-%Y’
22-oct-2015

1 Reply

L
Legacy User 1
8/1/2019, 5:39:27 AM

Use translate command (tr) to change to uppercase as shown below.

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

Leave a Reply

All replies are subject to pre-moderation. Your reply will appear publicly once approved.

S
SPYTM

Experience the pinnacle of digital communication. The ultimate ultra-premium platform designed for those who demand excellence.

© 2026 SPYTM. All rights reserved.