# FormatTime and reading from json for calculations

**URL:** <https://forums.eggplantsoftware.com/t/formattime-and-reading-from-json-for-calculations/14567>\
**Category:** Uncategorized\
**Created:** [August 14, 2025, 8:46pm UTC](https://forums.eggplantsoftware.com/t/formattime-and-reading-from-json-for-calculations/14567 "2025-08-14T20:46:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![GTPWilks](https://forums.eggplantsoftware.com/user_avatar/forums.eggplantsoftware.com/gtpwilks/32/170_2.png) [@GTPWilks](https://forums.eggplantsoftware.com/u/GTPWilks)\
**Post date:** [August 14, 2025, 8:46pm UTC](https://forums.eggplantsoftware.com/t/formattime-and-reading-from-json-for-calculations/14567/1 "2025-08-14T20:46:45Z")

</div>

Having trouble understanding how a date and a time together doesn’t work to make calculations

 ![image](https://forums.eggplantsoftware.com/uploads/default/original/1X/ddc28166507ba4215d92cda466cedd5c73b7c5ff.png)

In short, when a test finishes I execute the following code and store in a json  
Set ScriptData.ExecutionEndTime to formattedTime(“MM/dd/yyyy HH:mm”)

So I might have the value “08/14/2025 14:39” in my json but what I cannot figure out is if I read that value in from the json it cannot do a calculation on it to see if its been say 12 hours since last execution

---

<div class="post-metadata">

**Author:** ![Keiichi\_Yamamoto](https://forums.eggplantsoftware.com/letter_avatar_proxy/v4/letter/k/a8b319/32.png) [@Keiichi\_Yamamoto](https://forums.eggplantsoftware.com/u/Keiichi_Yamamoto)\
**Post date:** [August 15, 2025, 6:30pm UTC](https://forums.eggplantsoftware.com/t/formattime-and-reading-from-json-for-calculations/14567/2 "2025-08-15T18:30:07Z")

</div>

Does this work?

```auto
Set ABC to "08/14/2025 14:39"
log formattedTime("[mo]/[da]/[year] [hr24]:[mi]", ABC) + 12 days

```

Or you can do

```auto
// Run "log JSONFormat(the timeInputFormat)" to check what date time formats are currently supported by SenseTalk.
// The format "[mo]/[da]/[year] [hr24]:[mi]" is not listed there.
// so you can add it to the timeInputFormat global property
insert "[mo]/[da]/[year] [hr24]:[mi]" into the timeInputFormat
Set ABC to "08/14/2025 14:39"
log ABC + 12 days

```

---

<div class="post-metadata">

**Author:** ![GTPWilks](https://forums.eggplantsoftware.com/user_avatar/forums.eggplantsoftware.com/gtpwilks/32/170_2.png) [@GTPWilks](https://forums.eggplantsoftware.com/u/GTPWilks)\
**Post date:** [August 15, 2025, 7:35pm UTC](https://forums.eggplantsoftware.com/t/formattime-and-reading-from-json-for-calculations/14567/3 "2025-08-15T19:35:26Z")

</div>

> [@Keiichi\_Yamamoto](#):
>
> ```auto
> Set ABC to "08/14/2025 14:39"
> log formattedTime("[mo]/[da]/[year] [hr24]:[mi]", ABC) + 12 days
> 
> ```

This works, thanks  
I was stuck on using the Unicode style for the format call out since it was partially working
