When calling an API, I need to provide a start time and an end time in ISO 8601 format (UTC time).
I want to call the API in a CRON job, so I can't manually create the date-time(s).
How can I use the date
command to achieve what I want?
Note: I have already read other questions, where the answers show how to output the current date-time, like TZ=GMT date +"%Y-%m-%dT%H:%M:%SZ"
. This doesn't provide a solution for outputting a date-time into the future.
Example API payload:
{
"displayName": "string",
"endDateTime": "2024-03-12T07:06:44.266Z",
"startDateTime": "2024-03-12T07:06:44.266Z"
}