# Ignition report t\_stamp format

**URL:** <https://forum.inductiveautomation.com/t/ignition-report-t-stamp-format/76269>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [July 12, 2023, 4:34pm UTC](https://forum.inductiveautomation.com/t/ignition-report-t-stamp-format/76269 "2023-07-12T16:34:59Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Josue\_Cuadras](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/josue_cuadras/32/59915_2.png) [@Josue\_Cuadras](https://forum.inductiveautomation.com/u/Josue_Cuadras)\
**Post date:** [July 12, 2023, 4:34pm UTC](https://forum.inductiveautomation.com/t/ignition-report-t-stamp-format/76269/1 "2023-07-12T16:34:59Z")

</div>

Hello everyone,

I am trying to give a format the t\_stamp, for example the t\_stamp as seen in the graph is 2023-07-11 12:32:00, I would like to change the format to 07/11/2023 for example.

Within the Data section in the SQL query with which commands could this be done?

Thanks in advanced!

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/6/c66c91880c989aa1dc94b2261b55342c1bf8e132.jpeg)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/d/ed2274fced834051a80c6587ed5195f008e128cd.jpeg)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 12, 2023, 4:40pm UTC](https://forum.inductiveautomation.com/t/ignition-report-t-stamp-format/76269/2 "2023-07-12T16:40:16Z")

</div>

Datetime formatting will depending on the DB type you're connecting to; based on the square brackets I'll guess MSSQL, so you'll probably want the FORMAT builtin:

> **[FORMAT (Transact-SQL) - SQL Server](https://learn.microsoft.com/en-us/sql/t-sql/functions/format-transact-sql?view=sql-server-ver16)**
>
> Transact-SQL reference for the FORMAT function.

---

<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:** [July 12, 2023, 4:53pm UTC](https://forum.inductiveautomation.com/t/ignition-report-t-stamp-format/76269/3 "2023-07-12T16:53:09Z")

</div>

Welcome to the forum but please post code, not screengrabs of code and certainly not photographs of code! There's also a code formatting \</\> button on the editor to format it correctly, preserve indents and apply syntax highlighting.

---

<div class="post-metadata">

**Author:** ![Josue\_Cuadras](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/josue_cuadras/32/59915_2.png) [@Josue\_Cuadras](https://forum.inductiveautomation.com/u/Josue_Cuadras)\
**Post date:** [July 12, 2023, 6:01pm UTC](https://forum.inductiveautomation.com/t/ignition-report-t-stamp-format/76269/4 "2023-07-12T18:01:48Z")

</div>

I’m actually using mysql

---

<div class="post-metadata">

**Author:** ![Josue\_Cuadras](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/josue_cuadras/32/59915_2.png) [@Josue\_Cuadras](https://forum.inductiveautomation.com/u/Josue_Cuadras)\
**Post date:** [July 12, 2023, 6:09pm UTC](https://forum.inductiveautomation.com/t/ignition-report-t-stamp-format/76269/5 "2023-07-12T18:09:23Z")

</div>

Have not been able to resolver this yet.

---

<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:** [July 12, 2023, 6:13pm UTC](https://forum.inductiveautomation.com/t/ignition-report-t-stamp-format/76269/6 "2023-07-12T18:13:48Z")

</div>

The recommended practice is to save and extract the data as UTC. Ignition does this by default.

Keep the data as a timestamp type and don't convert it to a string. Format it at the point of use as late as possible. In this case that's in the chart.

Ignition will display it corrected for the timezone specified in Project | Project Properties | Perspective | General | Project Timezone. You probably want to set this to Client rather than Gateway.

---

<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:** [July 12, 2023, 6:22pm UTC](https://forum.inductiveautomation.com/t/ignition-report-t-stamp-format/76269/7 "2023-07-12T18:22:25Z")

</div>

> [@Transistor](#):
>
> save and extract the data as UTC. Ignition does this by default.

Well, not for MS SQL Server connections and their DATETIME column type, unless the GW-DB connection itself is in UTC.

Java with MS SQL Server is an interoperability nightmare.

---

<div class="post-metadata">

**Author:** ![Josue\_Cuadras](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/josue_cuadras/32/59915_2.png) [@Josue\_Cuadras](https://forum.inductiveautomation.com/u/Josue_Cuadras)\
**Post date:** [July 13, 2023, 12:09am UTC](https://forum.inductiveautomation.com/t/ignition-report-t-stamp-format/76269/8 "2023-07-13T00:09:37Z")

</div>

I resolved the issue with the next code:

```auto
SELECT Convert (varchar, assy_cv1_stopcond.t_stamp, [number format]) * FROM assy_cv1_stopcond

```

Depending in the number fortmat you choose, you can have differetn type of date, time or datetime formats. Example:

```auto
SELECT Convert (varchar, getdate(), 1)

```

This code would give you the next output:

mm/dd/yy = 07/12/2023

Here is a link to all the numeric formats, and a good explanation of how to use date and time conversions using SQL Server: [Date and Time Conversions Using SQL Server](https://www.mssqltips.com/sqlservertip/1145/date-and-time-conversions-using-sql-server/)
