# How to get rid of the miliseconds at the end of a date in Vision

**URL:** <https://forum.inductiveautomation.com/t/how-to-get-rid-of-the-miliseconds-at-the-end-of-a-date-in-vision/84222>\
**Category:** General Discussion\
**Tags:** vision, perspective\
**Created:** [January 12, 2024, 7:41pm UTC](https://forum.inductiveautomation.com/t/how-to-get-rid-of-the-miliseconds-at-the-end-of-a-date-in-vision/84222 "2024-01-12T19:41:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ben\_Blaschuk](https://avatars.discourse-cdn.com/v4/letter/b/5daacb/32.png) [@Ben\_Blaschuk](https://forum.inductiveautomation.com/u/Ben_Blaschuk)\
**Post date:** [January 12, 2024, 7:41pm UTC](https://forum.inductiveautomation.com/t/how-to-get-rid-of-the-miliseconds-at-the-end-of-a-date-in-vision/84222/1 "2024-01-12T19:41:07Z")

</div>

I have a custom property that I want to use to reference a SQL store procedure. I keep getting a Date format error and the only thing I can see that is different from Perspective is the extra -0600 at the end of my date. How do I get rid of it. I have the expression the same in Perspective and it works just fine.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/e/ee7c856d946503ad092b5308d09987cdcab93ae1.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/1/e17f28aed7452570adb2ed5d22ee7bdc6e50e96b.png)

> Blockquote  
> dateFormat(now(50000000), "yyyy-MM-dd HH:mm:ss")

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [January 13, 2024, 5:11am UTC](https://forum.inductiveautomation.com/t/how-to-get-rid-of-the-miliseconds-at-the-end-of-a-date-in-vision/84222/2 "2024-01-13T05:11:26Z")

</div>

The dateFormat expression returns a string, but the icon indicates that your custom property is a date datatype. Your exception depicts a SQL error, so perhaps you are passing the value into a SQL query as a string?

I recommend keeping the datatype as a date wherever possible. If you're using a named query or a prep query, a string conversion shouldn't be needed.

---

<div class="post-metadata">

**Author:** ![Ben\_Blaschuk](https://avatars.discourse-cdn.com/v4/letter/b/5daacb/32.png) [@Ben\_Blaschuk](https://forum.inductiveautomation.com/u/Ben_Blaschuk)\
**Post date:** [January 15, 2024, 4:05pm UTC](https://forum.inductiveautomation.com/t/how-to-get-rid-of-the-miliseconds-at-the-end-of-a-date-in-vision/84222/3 "2024-01-15T16:05:41Z")

</div>

ahhh.. the syntax gremlin got me again... I needed to add ' ' to the variables for them to activate. I will get it one of these days.

I will also post the whole code I am working with next time. I can feel the Ignition code guys face palming themselves when they read this. 🙂

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 15, 2024, 4:45pm UTC](https://forum.inductiveautomation.com/t/how-to-get-rid-of-the-miliseconds-at-the-end-of-a-date-in-vision/84222/4 "2024-01-15T16:45:24Z")

</div>

> [@Ben\_Blaschuk](#):
>
> to add ' ' to the variables

So, still relying on string conversion of your timestamp. You will likely regret this.

> [@Ben\_Blaschuk](#):
>
> face palming

Indeed.
