Rohan Gala
Rohan Gala

Reputation: 651

how to Output date as 10-Dec-15?

NOW=$(date +"%Y-%m-%d")  #displayed as 2015-12-10
DAY=$(date +"%d-%b-%Y")  #displayed as 10-Dec-2015
DAY1=$(date +"%d-%b")    #displayed as 10-Dec

how to Output date as 10-Dec-15?

Upvotes: 0

Views: 28

Answers (1)

Neil Masson
Neil Masson

Reputation: 2689

Use a small y which gives the short year as opposed to Y which gives the long year.

DAY=$(date +"%d-%b-%y")

Upvotes: 2

Related Questions