linux - how to convert number into date in unconventional format -
i have text file record dates in american format(mmddyy, e.g 070715). wondering if there easy way convert date, need date calculation. notice there date command allow convert string date ( date -d "string") can read date in ways. may able substring manipulation convert desired format, seems there should lot more simple way that.
using bash string manipulation can do:
s='070515' date -d "20${s: -2}-${s:0:2}-${s:2:2}" sun jul 5 00:00:00 edt 2015
Comments
Post a Comment