# Countdown to next service

**URL:** <https://forums.losant.com/t/countdown-to-next-service/879>\
**Category:** Help\
**Created:** [April 22, 2018, 4:41pm UTC](https://forums.losant.com/t/countdown-to-next-service/879 "2018-04-22T16:41:42Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Dylan\_Schuster](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/dylan_schuster/32/2850_2.png) [@Dylan\_Schuster](https://forums.losant.com/u/Dylan_Schuster)\
**Post date:** [April 23, 2018, 3:23pm UTC](https://forums.losant.com/t/countdown-to-next-service/879/2 "2018-04-23T15:23:03Z")

</div>

If you can store the date of the next service interval as a [number attribute](https://docs.losant.com/devices/state/#state-attributes) on a device, and format that number as a [Unix timestamp in milliseconds](https://www.epochconverter.com/), you could use an [Indicator Block](https://docs.losant.com/dashboards/indicator/) to display the next interval either as an absolute date or as a rounded value relative to the current time.

For an absolute date value (i.e. “Jan 1, 2019 at 12:30pm”), use the `{{formatDate}}` [format helper](https://docs.losant.com/workflows/accessing-payload-data/#format-helpers). Pass the [result of your query](https://docs.losant.com/dashboards/indicator/#query-result) as the first argument, and you can pass in a [Moment.js format string](https://momentjs.com/docs/#/displaying/format/) as the second argument to display in any format you’d like.

For a relative value (i.e. “in 14 days”), use the `{{formatDateRelative}}` helper. Again, pass the query result as the first argument, but do not pass a second argument to default to “now”.

You can even use the block’s [conditional statements](https://docs.losant.com/dashboards/indicator/#conditions) to change the background color or messaging as you approach the service window.

---

_[View the full topic](https://forums.losant.com/t/countdown-to-next-service/879)._
