# DateTime Conversion (openHAB 3.x)

**URL:** <https://community.openhab.org/t/datetime-conversion-openhab-3-x/107197>\
**Category:** Tutorials & Examples\
**Tags:** datetimetype, epoch, java-time-api\
**Created:** [October 26, 2020, 8:22pm UTC](https://community.openhab.org/t/datetime-conversion-openhab-3-x/107197 "2020-10-26T20:22:44Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![wellem](https://community.openhab.org/letter_avatar_proxy/v4/letter/w/e480ec/32.png) [@wellem](https://community.openhab.org/u/wellem)\
**Post date:** [December 28, 2020, 3:56pm UTC](https://community.openhab.org/t/datetime-conversion-openhab-3-x/107197/15 "2020-12-28T15:56:00Z")

</div>

> [@wellem](#):
>
> now.withTimeAtStartOfDay

thanks - now it works

I replaced

> now.withTimeAtStartOfDay

with

> ZonedDateTime.now().with(LocalTime.MIDNIGHT)

---

_[View the full topic](https://community.openhab.org/t/datetime-conversion-openhab-3-x/107197)._
