I wrote a code which convert epoch time to readable time
sd=`date -d '1970-01-01 UTC '$SDATE' seconds' +"%d-%m-%Y"`
the output is : 27-12-2002 but I want the output to be : 27/Nov/2002
how should i change my code?
sd=`date -d '1970-01-01 UTC '$SDATE' seconds' +"%d/%b/%Y"
I believe
There's a shortcut for "time from unix stamp": date -d @$STAMP. For the output, read man date
date -d @$STAMP
man date
Use %b instead:
%b
sd=`date -d '1970-01-01 UTC '$SDATE' seconds' +"%d/%b/%Y"`
Read man date for more details: