trilobite2
July 5th, 2018, 08:35 AM
Hi all -
I'm trying to convert a string to a date in bash using the date utility but it isn't working. Unfortunately, the string is in double-quotes and the date uses slashes as the separators.
I'm doing this (where $ is the prompt) -
$ date -d "28/06/2018" +'%d/%m/%Y'
This gives me an error - "date: invalid date ‘28/06/2018’ "
I hope someone can help! Thanks very much -
- trilobite2
I'm trying to convert a string to a date in bash using the date utility but it isn't working. Unfortunately, the string is in double-quotes and the date uses slashes as the separators.
I'm doing this (where $ is the prompt) -
$ date -d "28/06/2018" +'%d/%m/%Y'
This gives me an error - "date: invalid date ‘28/06/2018’ "
I hope someone can help! Thanks very much -
- trilobite2