공부
[Sh] convert string to date
승가비
2020. 8. 10. 22:02
728x90
date -d '20121212 7 days'
date -d '12-DEC-2012 7 days'
date -d '2012-12-12 7 days'
date -d '2012-12-12 4:10:10PM 7 days'
date -d '2012-12-12 16:10:55 7 days'
date -d '20121212' +'%Y-%m-%d'
date -d '20121212 -7 days' +'%Y-%m-%d'
https://stackoverflow.com/questions/11144408/convert-string-to-date-in-bash/11144983
Convert string to date in bash
I have a string in the format "yyyymmdd". It is a string in bash and I want to get it converted into a date so that all other date functions can be used on it. "20121212" string into "20121212" date
stackoverflow.com
728x90