# Convert datetime with "yyyy-MM-dd'T'HH:mm:ss.SSSZ" format

**URL:** <https://forum.inductiveautomation.com/t/convert-datetime-with-yyyy-mm-ddthh-mm-ss-sssz-format/17829>\
**Category:** Ignition\
**Created:** [April 25, 2018, 3:24pm UTC](https://forum.inductiveautomation.com/t/convert-datetime-with-yyyy-mm-ddthh-mm-ss-sssz-format/17829 "2018-04-25T15:24:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nathan\_ICS](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nathan_ics/32/4047_2.png) [@Nathan\_ICS](https://forum.inductiveautomation.com/u/Nathan_ICS)\
**Post date:** [April 25, 2018, 3:24pm UTC](https://forum.inductiveautomation.com/t/convert-datetime-with-yyyy-mm-ddthh-mm-ss-sssz-format/17829/1 "2018-04-25T15:24:38Z")

</div>

I’m trying to convert a datetime that I get to local time. Maybe I’m doing something wrong but java does not like the format.

Here is an example date ‘2018-04-25T14:05:15.953Z’  
From the Java [simpleDateFormat](https://docs.oracle.com/javase/1.5.0/docs/api/java/text/SimpleDateFormat.html) this appears to be the format “yyyy-MM-dd’T’HH:mm:ss.SSSZ”

Thank you,

---

<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:** [April 25, 2018, 3:27pm UTC](https://forum.inductiveautomation.com/t/convert-datetime-with-yyyy-mm-ddthh-mm-ss-sssz-format/17829/2 "2018-04-25T15:27:12Z")

</div>

You need to escape the `Z` in your incoming date - that’s a valid formatting character in SimpleDateFormat.

```python
stringDate = '2018-04-25T14:05:15.953Z'
format = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"

print system.date.parse(stringDate, format)

```
