# Scope of date objects between ignition perspective and reporting modules

**URL:** <https://forum.inductiveautomation.com/t/scope-of-date-objects-between-ignition-perspective-and-reporting-modules/97121>\
**Category:** Ignition\
**Tags:** perspective, reporting\
**Created:** [October 11, 2024, 5:32am UTC](https://forum.inductiveautomation.com/t/scope-of-date-objects-between-ignition-perspective-and-reporting-modules/97121 "2024-10-11T05:32:56Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kylan\_O\_Brien](https://avatars.discourse-cdn.com/v4/letter/k/47e85d/32.png) [@Kylan\_O\_Brien](https://forum.inductiveautomation.com/u/Kylan_O_Brien)\
**Post date:** [October 11, 2024, 5:32am UTC](https://forum.inductiveautomation.com/t/scope-of-date-objects-between-ignition-perspective-and-reporting-modules/97121/1 "2024-10-11T05:32:56Z")

</div>

I am using a Tag Historian Query to fill a time series chart.  
Using Parameters StartDate and EndDate, defaults work as expected.

I set StartDate as "fromMillis(1728534256686)"  
I set EndDate as "fromMillis(1728537563688)"  
and the chart displays correctly.

When I set the params of a ReportViewer as an Expression binding and set StartDate as fromMillis(1728534256686) and  
EndDate as fromMillis(1728537563688)

I get a different time range.

time range in perspective:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/0/107c8618d8a20cd3653aeddfe38a63c26b6be018.png)

time range in reporting Preview:

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

Thanks for your time

---

<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:** [October 11, 2024, 11:56am UTC](https://forum.inductiveautomation.com/t/scope-of-date-objects-between-ignition-perspective-and-reporting-modules/97121/2 "2024-10-11T11:56:56Z")

</div>

That sort of problem usually means there's stringification happening somewhere, and java is trying to apply time zones, which are often different between clients and the gateway.

Share more details.

---

<div class="post-metadata">

**Author:** ![Kylan\_O\_Brien](https://avatars.discourse-cdn.com/v4/letter/k/47e85d/32.png) [@Kylan\_O\_Brien](https://forum.inductiveautomation.com/u/Kylan_O_Brien)\
**Post date:** [October 14, 2024, 3:14am UTC](https://forum.inductiveautomation.com/t/scope-of-date-objects-between-ignition-perspective-and-reporting-modules/97121/3 "2024-10-14T03:14:01Z")

</div>

Thank you for your time pturmel,

Some information about the gateway is provided:  
Gateway version: 8.1.35 (b2023120517)  
Operating System: Windows 10 | amd64  
Java Version: 17.0.8+7-LTS

Both the gateway and client are installed on the same VM  
It is windows 10 pro with:  
Time Zone Cen. Australia Daylight Time

I am unsure of how to gather further details which may help examine the stringification.

---

<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:** [October 14, 2024, 11:35am UTC](https://forum.inductiveautomation.com/t/scope-of-date-objects-between-ignition-perspective-and-reporting-modules/97121/4 "2024-10-14T11:35:34Z")

</div>

Show how you are using the parameters to get your data, and if via SQL queries, show the queries and column types.

---

<div class="post-metadata">

**Author:** ![Kylan\_O\_Brien](https://avatars.discourse-cdn.com/v4/letter/k/47e85d/32.png) [@Kylan\_O\_Brien](https://forum.inductiveautomation.com/u/Kylan_O_Brien)\
**Post date:** [October 14, 2024, 9:31pm UTC](https://forum.inductiveautomation.com/t/scope-of-date-objects-between-ignition-perspective-and-reporting-modules/97121/5 "2024-10-14T21:31:24Z")

</div>

The time series chart is configured with range keys something like this:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/1/e1bda434101e1ce2d0d3b7582daa51a0f6c2e8b3.jpeg)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/a/7aa5405ddc441830addda9b5bfca7abe0f68050c.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/2/c2f0290dcde6509da76838988ede26f172590d5f.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/4/849849c0ba3a60bcbb3b2626ea11bdac88c540be.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/4/a49c445269038626c19da4fb3ed84d539bf1ec39.png)

I’ve hard coded the defaults as follows which I believe isolated it from my amateur designing, although there are some relics of attempts to find a way of passing a string to the Tag Historian Query.

This is the report viewer, I was using an expression binding with the fromMillis function to test the ranges because the graph was only showing a day.

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

For this design I’d like to be passing the params to the GraphReport view from the GraphSelect view:

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

The custom properties endTime and startTime are overridden by two date input boxes if the user would like.

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

The table (background of previous image) in the select screen is populated by this query which applies a string filter to self-managed serial numbers and recipe names.

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

On row click just the start and end times are calculated and passed to the custom fields.

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

Get serial times is just a query that returns the minimum and maximum range under unstopped conditions.

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

The table itself stores t\_stamp as a bigint.

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

And it is populated when the tag running changes state.

---

<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:** [October 14, 2024, 10:28pm UTC](https://forum.inductiveautomation.com/t/scope-of-date-objects-between-ignition-perspective-and-reporting-modules/97121/6 "2024-10-14T22:28:54Z")

</div>

There's a lot to look at, but your default report `Edate` (1728537563688) doesn't match your computed `endTime` (1728616557492).

I'm not surprised you are getting different data.

(Consider **not** using millis except to catch time zone errors.)

Use a script data source in your report that logs your parameters' actual values and the first and last row from your history. Be aware that any datetime values will be stringified in the gateway timezone when logged.

(I suspect that you have a timezone problem that you are failing to work around by using long milliseconds.)

Consider using a report default start and end time that is obviously not applicable. Just make sure your report parameters are properly computed (log those, too).

Consider not making your own start/end date parameters when there are two standardized parameters there for exactly that purpose.

---

<div class="post-metadata">

**Author:** ![Kylan\_O\_Brien](https://avatars.discourse-cdn.com/v4/letter/k/47e85d/32.png) [@Kylan\_O\_Brien](https://forum.inductiveautomation.com/u/Kylan_O_Brien)\
**Post date:** [October 14, 2024, 11:56pm UTC](https://forum.inductiveautomation.com/t/scope-of-date-objects-between-ignition-perspective-and-reporting-modules/97121/7 "2024-10-14T23:56:11Z")

</div>

Thankyou for directing me towards how to log,  
I have removed the non standard parameters and these are the results.

From reports Preview:

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

From perspective:

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

Here is my logging script incase it is not accessing the StartDate/EndDate in a useful way.

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

---

<div class="post-metadata">

**Author:** ![Kylan\_O\_Brien](https://avatars.discourse-cdn.com/v4/letter/k/47e85d/32.png) [@Kylan\_O\_Brien](https://forum.inductiveautomation.com/u/Kylan_O_Brien)\
**Post date:** [October 15, 2024, 12:07am UTC](https://forum.inductiveautomation.com/t/scope-of-date-objects-between-ignition-perspective-and-reporting-modules/97121/8 "2024-10-15T00:07:58Z")

</div>

I've added an onclick event to the report to log what is being computed on the perspective side

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/5/9510ec65a14664194f660ebf7eb96975244da6dd.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/8/68950c24b43c978b6f4c46e92e08d2ca9153a0a8.png)

---

<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:** [October 15, 2024, 12:24am UTC](https://forum.inductiveautomation.com/t/scope-of-date-objects-between-ignition-perspective-and-reporting-modules/97121/9 "2024-10-15T00:24:20Z")

</div>

Preview has a 100-row limit from history, Perspective report viewer does not. Also show your updated tag history query that uses StartDate and EndDate. Make sure there's no use of the original Sdate and Edate anywhere.

Your history query first and last row suggest a timezone error introduced somewhere.

---

<div class="post-metadata">

**Author:** ![Kylan\_O\_Brien](https://avatars.discourse-cdn.com/v4/letter/k/47e85d/32.png) [@Kylan\_O\_Brien](https://forum.inductiveautomation.com/u/Kylan_O_Brien)\
**Post date:** [October 15, 2024, 12:26am UTC](https://forum.inductiveautomation.com/t/scope-of-date-objects-between-ignition-perspective-and-reporting-modules/97121/10 "2024-10-15T00:26:21Z")

</div>

Thankyou for all your help. The results are the same once the limit are removed, although I was hoping for the returned start and end time to be reflected in the timeline graph, it is likely returning the most recent data point before the timespan.

The introduction of timezone error I am unsure how to investigate, the ACDT that is being passed is correct. I can investigate the gateway and see if there is some timezone settings for the historian that are not configured correctly.
