0

I'm developing a Clio integration with access to the calendar, but there's been an issue with dates. While the documentation says they expect an ISO-8601 timestamp date, it seems like there's something adding offset to the timezone value in dates being sent to the system.

For example, if I send a date 2018-05-17T23:59:59.999999-04:00 on both start_at and end_at properties when creating a calendar entry for an all day event, the value returned when fetching this entry through the API is 2018-05-17T17:00:00-07:00, which is clearly wrong. Am I missing something here?

The expected result should be something like either 2018-05-17T23:59:59-04:00 or 2018-05-18T03:59:59Z if milliseconds are ignored.

chocoelho
  • 11
  • 1
  • 5

1 Answers1

0

All dates are based on UTC timezone. Could it be that your site/server/script is set to a local timezone and so the dates are off for part of the day?

Try setting your scripting environment to UTC time before making any date/time-based queries.

Dean Householder
  • 549
  • 1
  • 7
  • 13
  • In this case, the dates had to be sent in UTC and reduced by a day to properly display in Clio calendar due to the fact that there's some rounding taking place when dates get stored in there. As to the timezone question: yes, my own timezone is getting mixed together with the user timezone defined in Clio whenever I make requests through their API. – chocoelho Jan 28 '20 at 22:01