You're most welcome, happy to help. I was in excatcly your shoes only a few months ago!
As for your next question, let me introduce you to my little friend.... ISO 8601. The underlying problem is that FireDAC (or perhaps other sources of date/time data) strictly adhere to one format, whereas the SetJsonData function strictly adheres to a different format (though technically in the same standard?!). So SetJsonData just ignores it.
I ran into this exact problem and tackled it in perhaps not the most elegant way here. I just changed the date/time format that FireDAC uses when it generates JSON. Which wasn't an easy thing to figure out.
I don't know if there are other, easier alternatives. Maybe alter the contents of the JSON after it has been generated? Or if there is way to change FireDAC's output without altering its source code. Perhaps altering the source code for SetJsonData could also work, but that's even less desirable given that TMS updates their codebase far more frequently than I update FireDAC. Ideally TMS will at some point update it to also accept these popular variants of ISO 8601.
As for the field-generating code, I do the initialization just as youv'e got there for Date
and DateTimeStamp
. I don't know if I've run across any Time
fields yet but probably the same approach would apply. Depending on your underlying databases there are quite a number of other types of fields that could come into play, so keep an eye out for those as well.