# SQL Lite Date Time format to Mysql timestamp

**URL:** <https://forum.inductiveautomation.com/t/sql-lite-date-time-format-to-mysql-timestamp/3239>\
**Category:** Ignition\
**Created:** [September 1, 2011, 7:13am UTC](https://forum.inductiveautomation.com/t/sql-lite-date-time-format-to-mysql-timestamp/3239 "2011-09-01T07:13:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gnguyen](https://avatars.discourse-cdn.com/v4/letter/g/41988e/32.png) [@gnguyen](https://forum.inductiveautomation.com/u/gnguyen)\
**Post date:** [September 1, 2011, 7:13am UTC](https://forum.inductiveautomation.com/t/sql-lite-date-time-format-to-mysql-timestamp/3239/1 "2011-09-01T07:13:33Z")

</div>

Hi,

I’ve a SQL Lite DB holding historical data (trendlog) and date and time in a string format ; by using a jdbc jar, I can read/write the db but handling timestamp is a different story.

I’ve SQLTags for each column (ID(int), SEQ(int), time\_stamp(string), Value(float), Quality(int)) and need to store it with historical group. Of course, time\_stamp is from the equipment and is different (older) from gateway or client time.

How can I convert 2011-08-17T14:10:23.000 to a MySQL timestamp ?

Regards,

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [September 1, 2011, 9:33am UTC](https://forum.inductiveautomation.com/t/sql-lite-date-time-format-to-mysql-timestamp/3239/2 "2011-09-01T09:33:22Z")

</div>

Replacing the “T” with a space would seem to do the trick. You can then log the expression as the time stamp and not the SQLTag directly.

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/1X/86d05c69b1b74ec2c9b12f38ad9b45fa658b561d.png)

---

<div class="post-metadata">

**Author:** ![gnguyen](https://avatars.discourse-cdn.com/v4/letter/g/41988e/32.png) [@gnguyen](https://forum.inductiveautomation.com/u/gnguyen)\
**Post date:** [September 1, 2011, 9:38am UTC](https://forum.inductiveautomation.com/t/sql-lite-date-time-format-to-mysql-timestamp/3239/3 "2011-09-01T09:38:45Z")

</div>

WoW Jordan…  
Not yet tested but so simple that of course I would have never thought about it 😉  
I’ll test it quickly.

Many thanks.
