CMDBuild Forum

Timestamp Format for Rest API

When attempting to use PUT through Rest API and update a device, I run into a problem when formatting the date correctly. I continuously get the following error message: 

java.lang.RuntimeException: error converting raw value = '2019-06-27'T'17:25:40' for attribute type = org.cmdbuild.dao.entrytype.attributetype.DateTimeAttributeType@66552aff, caused by: java.lang.IllegalArgumentException: unsupported date/time format, unable to parse string = '2019-06-27'T'17:25:40'

I had previously looked at other forums and found it should be "yyyy-MM-dd'T'HH:mm:ss" . In the error above you can see I've tried that. I have also attempted to remove the seconds ( leaving just "yyyy-MM-dd'T'HH:mm" ) but had no success. Let me know if there is some place to check how it would like to receive the timestamp or if you have a suggestion to change the accepted format.

Thanks in advance,

Matt

Have you tried writing the timestamp without the " ' " symbol before and after the T? Like in your case the date would be written like this: 2019-06-27T17:25:40
CMDBuild Team

Previously Tecnoteca wrote:

Have you tried writing the timestamp without the " ' " symbol before and after the T? Like in your case the date would be written like this: 2019-06-27T17:25:40
CMDBuild Team

 

Hey I just saw your message, 
 
I found that just inputting the date as "dd/MM/yyyy" worked; however, it obviously is missing the time element. Your suggestion seemed to work as well with the format "yyyy-MM-ddTHH:mm:ss" where T is just the letter. I updated via PUT with the RestAPI and it resembled the new time in the repo along with the date. 
 
 Thanks for the help Tecnoteca.  :)