# DateTimeInput - which datatype to use?

**URL:** <https://forum.inductiveautomation.com/t/datetimeinput-which-datatype-to-use/80478>\
**Category:** Maker\
**Created:** [October 13, 2023, 10:02pm UTC](https://forum.inductiveautomation.com/t/datetimeinput-which-datatype-to-use/80478 "2023-10-13T22:02:02Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vidar\_Hetlelid](https://avatars.discourse-cdn.com/v4/letter/v/dfb087/32.png) [@Vidar\_Hetlelid](https://forum.inductiveautomation.com/u/Vidar_Hetlelid)\
**Post date:** [October 13, 2023, 10:02pm UTC](https://forum.inductiveautomation.com/t/datetimeinput-which-datatype-to-use/80478/1 "2023-10-13T22:02:02Z")

</div>

Hi there. I want to get the date and time from the datetimeinput, via OPCUA. I dont get which datatype i should use for this?  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/6/66668bf4cd50b051ab0f4d39fbd6798fe7c62c58.png)

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [October 13, 2023, 10:09pm UTC](https://forum.inductiveautomation.com/t/datetimeinput-which-datatype-to-use/80478/2 "2023-10-13T22:09:02Z")

</div>

The calendar icon on the value property shows you that is a date/time type already.

- Create a memory tag of type dateline.
- Bind your DateTimeInput value property to the tag.

The remote OPC UA client should now be able to read the tag.

Note that you have picked type set to time. Check the options.

---

<div class="post-metadata">

**Author:** ![Vidar\_Hetlelid](https://avatars.discourse-cdn.com/v4/letter/v/dfb087/32.png) [@Vidar\_Hetlelid](https://forum.inductiveautomation.com/u/Vidar_Hetlelid)\
**Post date:** [October 14, 2023, 9:39pm UTC](https://forum.inductiveautomation.com/t/datetimeinput-which-datatype-to-use/80478/3 "2023-10-14T21:39:42Z")

</div>

Thank you. But im not quite sure how to do this. I have created a new memory tag, then drag and drop it to the datetimepicker like this:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/5/f5b3f4a51395abb25c7bde28ca913a42a86a4f0a.png)

When i go online, i get this error:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/a/aa12ca1043736c77bf16e6679b8766e26747f23d.png)

Any ideas?

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [October 14, 2023, 9:49pm UTC](https://forum.inductiveautomation.com/t/datetimeinput-which-datatype-to-use/80478/4 "2023-10-14T21:49:35Z")

</div>

That's strange.

- Check the binding (blue link icon) and make sure it's set to **bidirectional**. That will allow the component to write to the tag - otherwise it can only read it (but I don't think that's the problem).
- If the red error triangle is showing at the top right of the Property Editor pane then hover over it and get the error message.
- There's an 'i' icon on the error message. Does that give you anything?

---

<div class="post-metadata">

**Author:** ![Vidar\_Hetlelid](https://avatars.discourse-cdn.com/v4/letter/v/dfb087/32.png) [@Vidar\_Hetlelid](https://forum.inductiveautomation.com/u/Vidar_Hetlelid)\
**Post date:** [October 14, 2023, 10:13pm UTC](https://forum.inductiveautomation.com/t/datetimeinput-which-datatype-to-use/80478/5 "2023-10-14T22:13:40Z")

</div>

Thanks. It is set to bidirectional, and there is no error message 😕

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [October 14, 2023, 10:16pm UTC](https://forum.inductiveautomation.com/t/datetimeinput-which-datatype-to-use/80478/6 "2023-10-14T22:16:39Z")

</div>

Good.  
Don't forget to mark my post above as the solution. It may help others.

---

<div class="post-metadata">

**Author:** ![Vidar\_Hetlelid](https://avatars.discourse-cdn.com/v4/letter/v/dfb087/32.png) [@Vidar\_Hetlelid](https://forum.inductiveautomation.com/u/Vidar_Hetlelid)\
**Post date:** [October 14, 2023, 10:19pm UTC](https://forum.inductiveautomation.com/t/datetimeinput-which-datatype-to-use/80478/7 "2023-10-14T22:19:49Z")

</div>

Sorry, i meant that there was no error message. I still got the same issue.

When i tried to format to 23:22, i get this error though.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/4/64dfd0f5aef08638094c5e0a414a948707c6b189.png)

EDIT:  
Now I understand what you meant regarding the "i" in the error. This is what it tells me:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/6/46101f1c9137e10c5f77b9d75782b3cf74120949.png)

EDIT 2:  
I dont know why, but now it works. but i can only change the hour between 22 and 23:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/e/fe5d4976d6ec9ea80661e737f2417bacb700d9ce.png)

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [October 14, 2023, 10:37pm UTC](https://forum.inductiveautomation.com/t/datetimeinput-which-datatype-to-use/80478/8 "2023-10-14T22:37:26Z")

</div>

More checks:

- What is the datatype of your tag? Make sure it is datetime (or whatever they call it).
- Check if the `minDate` and `maxDate` properties are limiting the settings.

A quick check is to create a second DateTimeInput component and bind that to the same tag. It will give you a clean start.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [October 14, 2023, 10:44pm UTC](https://forum.inductiveautomation.com/t/datetimeinput-which-datatype-to-use/80478/9 "2023-10-14T22:44:04Z")

</div>

> [@Vidar\_Hetlelid](#):
>
> When i tried to format to 23:22, i get this error though.

If you're going to type a value into the component properties value field then it has to be a full datetime, e.g., `value : 2023-10-14 22:13:00` including the ss. An easier way to modify it is to select the calendar icon to the right of the value property.

---

<div class="post-metadata">

**Author:** ![Vidar\_Hetlelid](https://avatars.discourse-cdn.com/v4/letter/v/dfb087/32.png) [@Vidar\_Hetlelid](https://forum.inductiveautomation.com/u/Vidar_Hetlelid)\
**Post date:** [October 14, 2023, 10:46pm UTC](https://forum.inductiveautomation.com/t/datetimeinput-which-datatype-to-use/80478/10 "2023-10-14T22:46:39Z")

</div>

Thank you. I tried to delete it, and use a new component, still the same issue. Also noe effect when changing the min and max 😕

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [October 14, 2023, 10:56pm UTC](https://forum.inductiveautomation.com/t/datetimeinput-which-datatype-to-use/80478/11 "2023-10-14T22:56:04Z")

</div>

OK. Right-click on the binding and disable it. Run the Designer preview mode and see if the component works.  
If that's OK then launch the project and test it in a browser.  
Report back - but it's midnight in Ireland!

---

<div class="post-metadata">

**Author:** ![Vidar\_Hetlelid](https://avatars.discourse-cdn.com/v4/letter/v/dfb087/32.png) [@Vidar\_Hetlelid](https://forum.inductiveautomation.com/u/Vidar_Hetlelid)\
**Post date:** [October 14, 2023, 11:00pm UTC](https://forum.inductiveautomation.com/t/datetimeinput-which-datatype-to-use/80478/12 "2023-10-14T23:00:39Z")

</div>

I've already tried it, both in designer preview and browser. Thanks for helping out, and good night. Its late in Norway aswell 🙂
