# Chart X axis Timestamp doesn't match my Dataset timestamp

**URL:** <https://forum.inductiveautomation.com/t/chart-x-axis-timestamp-doesnt-match-my-dataset-timestamp/50032>\
**Category:** Ignition\
**Tags:** database, perspective\
**Created:** [August 18, 2021, 9:34am UTC](https://forum.inductiveautomation.com/t/chart-x-axis-timestamp-doesnt-match-my-dataset-timestamp/50032 "2021-08-18T09:34:43Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![carlos.aguero](https://avatars.discourse-cdn.com/v4/letter/c/cab0a1/32.png) [@carlos.aguero](https://forum.inductiveautomation.com/u/carlos.aguero)\
**Post date:** [August 18, 2021, 9:34am UTC](https://forum.inductiveautomation.com/t/chart-x-axis-timestamp-doesnt-match-my-dataset-timestamp/50032/1 "2021-08-18T09:34:43Z")

</div>

I have a named query that returns Date Time and Qty columns, which I am using in a time series chart in perspective.  
I don’t know why the X axis time stamp (AM/PM) doesn’t match the time from my Data…  
I am starting my data at 5AM but the X axis shows 5PM… any clue how to correct this?..

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/7/97f460d6b4c56127e6126b043904898aa533f884.png)

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [August 18, 2021, 11:12am UTC](https://forum.inductiveautomation.com/t/chart-x-axis-timestamp-doesnt-match-my-dataset-timestamp/50032/2 "2021-08-18T11:12:35Z")

</div>

it probbaly changes it because you have a different locale than the gateway

---

<div class="post-metadata">

**Author:** ![carlos.aguero](https://avatars.discourse-cdn.com/v4/letter/c/cab0a1/32.png) [@carlos.aguero](https://forum.inductiveautomation.com/u/carlos.aguero)\
**Post date:** [August 19, 2021, 1:08am UTC](https://forum.inductiveautomation.com/t/chart-x-axis-timestamp-doesnt-match-my-dataset-timestamp/50032/3 "2021-08-19T01:08:51Z")

</div>

where can I change the local time.?. I tried project properties/Perspective/General/Timezone…  
different values and nothing cahnges…  
I still have my X axis chart off by 1 day and 1 hour  
O\_o

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/7/2791ef116460b0bececf7581792a49b889e1e090.png)

additional ideas?.. thank you

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [August 19, 2021, 7:00am UTC](https://forum.inductiveautomation.com/t/chart-x-axis-timestamp-doesnt-match-my-dataset-timestamp/50032/4 "2021-08-19T07:00:15Z")

</div>

where do fill this dataset up? because it could be that the dataset itself also already is changed

---

<div class="post-metadata">

**Author:** ![carlos.aguero](https://avatars.discourse-cdn.com/v4/letter/c/cab0a1/32.png) [@carlos.aguero](https://forum.inductiveautomation.com/u/carlos.aguero)\
**Post date:** [August 22, 2021, 3:58pm UTC](https://forum.inductiveautomation.com/t/chart-x-axis-timestamp-doesnt-match-my-dataset-timestamp/50032/5 "2021-08-22T15:58:04Z")

</div>

The data is coming from a Named Query, when testing the Named Query the returned data matches my SQL table…

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/2/029e2a786a128238bf56a7f6e1ae6ad257aa3bba.jpeg)

even my Dataset matches my SQL table DateTime values… but when adding a time series chart the X axis Date-time doesn’t match my DateTime column values…

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/1/b1293c9bc2ec079728bd7ca141700ebeecd2b0e0.jpeg)

I tried other tables and different SQL servers that I hava available and the Datetime is always off in the timeseries chart…  
totally lost in here… no clue what else I can do…

Thanks!

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [August 23, 2021, 6:31am UTC](https://forum.inductiveautomation.com/t/chart-x-axis-timestamp-doesnt-match-my-dataset-timestamp/50032/6 "2021-08-23T06:31:59Z")

</div>

can you query to json? or does that not work for the chart?  
And maybe get one date and get the timezone from it with one of these

- [system.date.getTimezone](https://docs.inductiveautomation.com/display/DOC81/system.date.getTimezone)

- [system.date.getTimezoneOffset](https://docs.inductiveautomation.com/display/DOC81/system.date.getTimezoneOffset)

are you running the gateway on a diffrent machine? what is the timezone on it?

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [May 9, 2022, 3:24pm UTC](https://forum.inductiveautomation.com/t/chart-x-axis-timestamp-doesnt-match-my-dataset-timestamp/50032/7 "2022-05-09T15:24:55Z")

</div>

I have the same problem:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/7/9764b020e0724dc64941cd4dc96b4a20c7e49ebf.png)

As you can see, the X trace shows 5:26 (which matches the actual timestamp of the data), but the time axis is off by about 30 minutes…

This is the case for every tag and time settings I’ve tried.  
Any idea what’s going on ?

---

<div class="post-metadata">

**Author:** ![Mayur\_Sakshi](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@Mayur\_Sakshi](https://forum.inductiveautomation.com/u/Mayur_Sakshi)\
**Post date:** [July 8, 2024, 10:31am UTC](https://forum.inductiveautomation.com/t/chart-x-axis-timestamp-doesnt-match-my-dataset-timestamp/50032/8 "2024-07-08T10:31:04Z")

</div>

When rendering the date time column from a query, parse it as a string in your script, str(yourdatetimeobject). This will solve your problem.
