# Document stores my ignition tag.timestamp as unicode and I cannot parse it now!

**URL:** <https://forum.inductiveautomation.com/t/document-stores-my-ignition-tag-timestamp-as-unicode-and-i-cannot-parse-it-now/42934>\
**Category:** Ignition\
**Tags:** perspective, ignition80\
**Created:** [February 3, 2021, 1:54am UTC](https://forum.inductiveautomation.com/t/document-stores-my-ignition-tag-timestamp-as-unicode-and-i-cannot-parse-it-now/42934 "2021-02-03T01:54:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tmahaffey](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tmahaffey/32/30949_2.png) [@tmahaffey](https://forum.inductiveautomation.com/u/tmahaffey)\
**Post date:** [February 3, 2021, 1:54am UTC](https://forum.inductiveautomation.com/t/document-stores-my-ignition-tag-timestamp-as-unicode-and-i-cannot-parse-it-now/42934/1 "2021-02-03T01:54:22Z")

</div>

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!

```auto
#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!

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [February 3, 2021, 4:10pm UTC](https://forum.inductiveautomation.com/t/document-stores-my-ignition-tag-timestamp-as-unicode-and-i-cannot-parse-it-now/42934/2 "2021-02-03T16:10:40Z")

</div>

Are you sure it’s actually a string? Try logging/printing `type(yourValue)`.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [February 3, 2021, 4:57pm UTC](https://forum.inductiveautomation.com/t/document-stores-my-ignition-tag-timestamp-as-unicode-and-i-cannot-parse-it-now/42934/3 "2021-02-03T16:57:37Z")

</div>

I believe the issue here is that you are using two place holders for the time zone and in reality you only need 1.

z is the General Time Zone place holder  
XXX is the ISO 8601 Time Zone.

Z as defined by the java SimpleDateFormat includes the following format

Remove the XXX and you should get the expected result

```auto
time = 'Tue Feb 02 11:49:09 GMT-07:00 2021'

time = system.date.parse(time,'E MMM dd HH:mm:ss z yyyy')

print type(time)
print time

```

Result

```auto
<type 'java.util.Date'>
Tue Feb 02 13:49:09 EST 2021

```

Note, I’m in the eastern time zone so it converted the time to my time zone.
