# Get the Elapsed Time between 2 dates (now() - date)

**URL:** <https://forum.inductiveautomation.com/t/get-the-elapsed-time-between-2-dates-now-date/99175>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [November 27, 2024, 11:20am UTC](https://forum.inductiveautomation.com/t/get-the-elapsed-time-between-2-dates-now-date/99175 "2024-11-27T11:20:58Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [November 27, 2024, 1:06pm UTC](https://forum.inductiveautomation.com/t/get-the-elapsed-time-between-2-dates-now-date/99175/4 "2024-11-27T13:06:04Z")

</div>

Another method adapted from [Paul's example](https://forum.inductiveautomation.com/t/convert-seconds-to-hh-mm-ss/8739/9)

```python
stringFormat("%02d d %02d:%02d:%02d.%02d", 
	daysBetween({[.]StartTime}, now()),
	hoursBetween({[.]StartTime}, now()) % 24,
	minutesBetween({[.]StartTime}, now()) % 60,
	secondsBetween({[.]StartTime}, now()) % 60,
	millisBetween({[.]StartTime}, now()) % 1000
)

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/get-the-elapsed-time-between-2-dates-now-date/99175)._
