I have a document tag that I am using to store some information and some timestamps. After I perform a system.tag.read(document_tag).value.toDict() on my tag, I get a nice python dictionary, but my timestamps are now unicode! I want to use some of ignitions handy system.date.isBefore() functions on my timestamps stored in the document, but, they must be converted to a dt object first. No probelm right? Wrong!
#Here is the unicode that is coming out of by document value:
time = 'Tue Feb 02 11:49:09 GMT-07:00 2021'
#Here is the best I way I can tell how to parse this string into a dt obj
time = system.date.parse(time, "E MMM d H:m:s zXXX yyyy")
I looked thorugh and through the documentation for parsing strings, and this looks correct. I’m sure a simple oversight! It would be nice to have an example of this in the parse examples since I’m sure people have tried to parse these dt objects that have been converted to unicode beofre!
Thanks a bunch ya’ll!