I am trying to update a Thing property of type "DATETIME" with a historical time through the REST API (I have a CSV file with datetime values that I want to sequentially update the Thing's properties with, but for now, I just want to update the property once).
I am currently using the Requests package in Python to communicate with the REST API, although I have previously tried this using the HTTPie extension in the Windows Command Prompt and had no luck no matter how I formatted the datetime value.
I have tried updating the Thing property with an example time by formatting the new value as a string in the same format that is returned in Python when you use a GET request for a datetime property's value (script below), but I wasn't successful. I keep getting the error "Unable To Convert From java.lang.String to DATETIME"
Does anyone happen to know how I can update the DATETIME property using Requests in Python (or any other http requests language, really. Anything is helpful)?
So, I had been attempting to update a DATETIME property for days, and within seconds of posting this question, I found something else, tried it, and it worked. Here's what I did for anyone who comes across the same problem:
I used the ISO 8601 format (YYYY-MM-DDTHH:MMS.mmmmmm) which I had just read is the standard format for date and time. My script now looks like this: