I need to parameter-ize a datetime value with an objective of passing to a constructed URI to make a Smartsheet API call to get data (i.e. sheets) changed in last 24 hours.
I want to use Linux date
command as I can do something like date -d '1 day ago' %F
to get the output of a day before today. How can I use the date command to convert the value to yyyy-MM-dd'T'HH:mm:ss'Z'
format to get something like 2018-01-01T00:00:00-07:00
?
If the value is not in this particular format, then Smartsheet API complains:
HTTP_01 - Error fetching resource. Status: 400 Reason:
Bad Request : { "errorCode" : 1018, "message" : "The value '/home/my/path/to/param_file/Sysdate' was not valid for the parameter modifiedSince.", "refId" : "1xqawd3s94f4y" }
Thanks,