# Parse datatime ignition perpective

**URL:** <https://forum.inductiveautomation.com/t/parse-datatime-ignition-perpective/66048>\
**Category:** Ignition\
**Created:** [November 3, 2022, 9:32am UTC](https://forum.inductiveautomation.com/t/parse-datatime-ignition-perpective/66048 "2022-11-03T09:32:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sebastien\_ng](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sebastien_ng/32/55297_2.png) [@sebastien\_ng](https://forum.inductiveautomation.com/u/sebastien_ng)\
**Post date:** [November 3, 2022, 9:32am UTC](https://forum.inductiveautomation.com/t/parse-datatime-ignition-perpective/66048/1 "2022-11-03T09:32:01Z")

</div>

Hello Someone can explain to me why I'am having a error whith the fucntion `system.date.parse`:

````auto
 my self.view.params.datetime = 03nov.2022 09:53:52 AM
date = system.date.parse(self.view.params.datetime,'ddMMMyyyy hh:mm:ss a')

On my log I found this error:
Error running action 'dom.onClick' on Building Automation Demo/Page/Systems Overview/Framework/Dashboard/Widgets/Activity ```
Log/Row@C$0:0:0$0:1$0:1$0:0[dashboard-widget-10]$0:0$0:3[0]/root/Body/User And More/More And Edit Cont/More: Traceback (most recent call last): File "<function:runAction>", line 14, in runAction at ```

java.base/java.text.DateFormat.parse(Unknown Source) at com.inductiveautomation.ignition.common.script.builtin.DateUtilities.parse(DateUtilities.java:445) at jdk.internal.reflect.GeneratedMethodAccessor476.invoke(Unknown Source)
``` at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown ```
Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) ```
java.text.ParseException: java.text.ParseException: Unparseable date: "03nov.2022 09:53:52 AM"

````

---

<div class="post-metadata">

**Author:** ![louagejasper](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/louagejasper/32/86311_2.png) [@louagejasper](https://forum.inductiveautomation.com/u/louagejasper)\
**Post date:** [November 3, 2022, 9:47am UTC](https://forum.inductiveautomation.com/t/parse-datatime-ignition-perpective/66048/2 "2022-11-03T09:47:28Z")

</div>

Hi,

I think you need to do it like this:

```auto
dateStr = "03nov.2022 09:53:52 AM"

date = system.date.parse(dateStr, "ddMMMM.yyyy hh:mm:ss a")
print date
#Output: Thu Nov 03 09:53:52 CET 2022

```

---

<div class="post-metadata">

**Author:** ![sebastien\_ng](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sebastien_ng/32/55297_2.png) [@sebastien\_ng](https://forum.inductiveautomation.com/u/sebastien_ng)\
**Post date:** [November 3, 2022, 10:07am UTC](https://forum.inductiveautomation.com/t/parse-datatime-ignition-perpective/66048/3 "2022-11-03T10:07:45Z")

</div>

Hi, I didn't understand what you wanted me to do

`03 nov.2022 09:53:52 AM` is a value that get on my param.  
I put script on a button. when I click it, I'm got the error that I have posted

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/3/63d9d64b6e372000d5be39e1c972c1e671a2bb77.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/6/56fadb571c96f05ddd89f33110510b6907323987.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/a/4a84cc7be4c29b2a5abc33a4c85b985f23cba27a.png)

---

<div class="post-metadata">

**Author:** ![louagejasper](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/louagejasper/32/86311_2.png) [@louagejasper](https://forum.inductiveautomation.com/u/louagejasper)\
**Post date:** [November 3, 2022, 10:14am UTC](https://forum.inductiveautomation.com/t/parse-datatime-ignition-perpective/66048/4 "2022-11-03T10:14:05Z")

</div>

Change

```auto
date = system.date.parse(self.view.params.datetime,'ddMMMyyyy hh:mm:ss a')

```

to

```auto
date = system.date.parse(self.view.params.datetime,'ddMMMM.yyyy hh:mm:ss a')

```

---

<div class="post-metadata">

**Author:** ![sebastien\_ng](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sebastien_ng/32/55297_2.png) [@sebastien\_ng](https://forum.inductiveautomation.com/u/sebastien_ng)\
**Post date:** [November 3, 2022, 10:24am UTC](https://forum.inductiveautomation.com/t/parse-datatime-ignition-perpective/66048/5 "2022-11-03T10:24:25Z")

</div>

> [@louagejasper](#):
>
> `date = system.date.parse(self.view.params.datetime,'ddMMMM.yyyy hh:mm:ss a')`

thank you, it work now
