# System Get date error

**URL:** <https://forum.inductiveautomation.com/t/system-get-date-error/85564>\
**Category:** Ignition\
**Tags:** perspective, scripting\
**Created:** [February 12, 2024, 4:22pm UTC](https://forum.inductiveautomation.com/t/system-get-date-error/85564 "2024-02-12T16:22:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tomas\_Laso](https://avatars.discourse-cdn.com/v4/letter/t/e9a140/32.png) [@Tomas\_Laso](https://forum.inductiveautomation.com/u/Tomas_Laso)\
**Post date:** [February 12, 2024, 4:22pm UTC](https://forum.inductiveautomation.com/t/system-get-date-error/85564/1 "2024-02-12T16:22:28Z")

</div>

Hi all,

 ![Date_error](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/d/1d30d1475198b6edb37b739b6a9a4b87c3c5fb82.jpeg)

today I want to share an error i have with a script to use the system data. This script works properly till 2024, I´m looking for the error, but I suposse that is about the system date format so maybe any one have the same problem, could you help me with this error?

---

<div class="post-metadata">

**Author:** ![Tomas\_Laso](https://avatars.discourse-cdn.com/v4/letter/t/e9a140/32.png) [@Tomas\_Laso](https://forum.inductiveautomation.com/u/Tomas_Laso)\
**Post date:** [February 12, 2024, 4:25pm UTC](https://forum.inductiveautomation.com/t/system-get-date-error/85564/2 "2024-02-12T16:25:34Z")

</div>

I tried with capital letters "YYYY", but nothing happens.

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [February 12, 2024, 6:26pm UTC](https://forum.inductiveautomation.com/t/system-get-date-error/85564/3 "2024-02-12T18:26:44Z")

</div>

A Jython key error is usually because you are trying to access something in the dict where there's no corresponding key.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [February 12, 2024, 6:45pm UTC](https://forum.inductiveautomation.com/t/system-get-date-error/85564/4 "2024-02-12T18:45:46Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/e/3e89ccd5f67df827e0fb9a7b08689e3cd80a19f3.png)  
This is your problem line. `dictEstimado` has no key for '01'. You may want to print the entire `dictEstimado` before your loop so you can inspect or better yet open script console in designer run `dictEstimado = getDictEstimated(plantId, startTime, endTime)` with whatever parameters you are actually using and then you can really inspect it.

---

<div class="post-metadata">

**Author:** ![Tomas\_Laso](https://avatars.discourse-cdn.com/v4/letter/t/e9a140/32.png) [@Tomas\_Laso](https://forum.inductiveautomation.com/u/Tomas_Laso)\
**Post date:** [February 12, 2024, 8:58pm UTC](https://forum.inductiveautomation.com/t/system-get-date-error/85564/5 "2024-02-12T20:58:51Z")

</div>

But is working for more than a year, I can use data of 2023 but I tried with the data from January 2024 and only get the error, it´s quite strange for me

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [February 13, 2024, 5:51pm UTC](https://forum.inductiveautomation.com/t/system-get-date-error/85564/6 "2024-02-13T17:51:24Z")

</div>

It looks like `getDictEstimated` runs a query (line 213). That's probably why. You had records or a configuration for 2023, but now it rolled over and you don't have a config row or a data or _something_ and so the query doesn't return what you expect and so your dictionary is not what you expect.

You probably want to see what is going on in your `kpis_pr_estimado` table for your plantid and tstamp.
