I've got a cURL command that gets a date and sets it to a variable as a string. But then I want to use that variable as a date so I use the date command on the variable but it seems like the date command doesn't like this. How do I go about setting this variable as a date?
Example:
date=$(curl blahblahblah)
echo $date
"2017-11-02T13:23:52+00:00"
date -d $date +%s
date: invalid date ‘"2017-11-02T13:23:52+00:00"’
When I substitute $date for the actual value, it works fine.