티스토리 뷰

공부

[Sh] convert string to date

seunggabi 승가비 2020. 8. 10. 22:02
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

 

'공부' 카테고리의 다른 글

[Java] @JsonProperty show `is` prefix  (0) 2020.08.10
[Sh] for  (0) 2020.08.10
[Sh] convert string to date  (0) 2020.08.10
[Java] round for percent  (0) 2020.08.10
[Python] requests  (0) 2020.08.10
[Python] POST json  (0) 2020.08.10
댓글
댓글쓰기 폼