# Ignition Database datetime data input to View's param

**URL:** <https://forum.inductiveautomation.com/t/ignition-database-datetime-data-input-to-views-param/98655>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [November 15, 2024, 9:48am UTC](https://forum.inductiveautomation.com/t/ignition-database-datetime-data-input-to-views-param/98655 "2024-11-15T09:48:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Apxea](https://avatars.discourse-cdn.com/v4/letter/a/ad7895/32.png) [@Apxea](https://forum.inductiveautomation.com/u/Apxea)\
**Post date:** [November 15, 2024, 9:48am UTC](https://forum.inductiveautomation.com/t/ignition-database-datetime-data-input-to-views-param/98655/1 "2024-11-15T09:48:06Z")

</div>

Hello,everyone,

I’m working on a project in Ignition where I retrieve a date and time value from a database and store it in a view parameter (`view.params.datetime`). However, when I retrieve this value, its format changes to something like `"Tue Nov 05 2024 11:30:00 GMT+0900 (JAPAN Standard Time)"`. Additionally, the data type is recognized as `unicode`.

My goal is to take this view parameter (with its formatted date and time) and insert it into another database table. Unfortunately, because the format is not directly compatible with the database’s datetime format, I’m having trouble with the insertion.

I’ve tried various approaches to reformat this `unicode` date string to match the datetime format required by my database (`yyyy-MM-dd HH:mm:ss`), but I'm still encountering errors.

Does anyone know a reliable way to convert this `unicode` date string from the view parameter into a compatible datetime format for database insertion? Or is there a recommended method in Ignition to handle this type of timezone-stamped date string?

Thanks in advance for any advice or suggestions!

---

<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:** [November 15, 2024, 10:47am UTC](https://forum.inductiveautomation.com/t/ignition-database-datetime-data-input-to-views-param/98655/2 "2024-11-15T10:47:01Z")

</div>

Standard practice is to store date and time as DATETIME type in the database. Don't convert it to a string until you need to display it to a human. In addition, saving in UTC will avoid lots of problems with timezones and daylight saving.

Show us your query and someone may have suggestions for improvement. See [Wiki - how to post code on this forum](https://forum.inductiveautomation.com/t/wiki-how-to-post-code-on-this-forum/77831).
