# Problem with hour

**URL:** <https://community.homey.app/t/problem-with-hour/95067>\
**Category:** Developers\
**Created:** [November 19, 2023, 9:43am UTC](https://community.homey.app/t/problem-with-hour/95067 "2023-11-19T09:43:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![janrikard](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/janrikard/32/34785_2.png) [@janrikard](https://community.homey.app/u/janrikard)\
**Post date:** [November 19, 2023, 9:43am UTC](https://community.homey.app/t/problem-with-hour/95067/1 "2023-11-19T09:43:33Z")

</div>

Hi

Im making an app that gives a tag with diffrent time-stuff as a number-tag, for example current hour.

But when i use the function hourdate.getHours(); i get the hour 1 hour early.  
As i understand it the function should return local time.  
My computer and my homey is in CET(sweden).

Anyone know what im doing wrong?

---

<div class="post-metadata">

**Author:** ![Rmb](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rmb/32/79135_2.png) [@Rmb](https://community.homey.app/u/Rmb)\
**Post date:** [November 19, 2023, 9:54am UTC](https://community.homey.app/t/problem-with-hour/95067/2 "2023-11-19T09:54:09Z")

</div>

Search the forum, the answers you are looking for:

> [@Local time in HomeyScript](https://community.homey.app/t/local-time-in-homeyscript/33338/12):
>
> With SDKv3 (part of v5) Athom has decided to break Date functionality so it always returns times using the universal (UTC) timezone, even for methods that are supposed to return local times. See [this issue on Github](https://github.com/athombv/homey-apps-sdk-issues/issues/169). As of yet, Athom hasn’t given a satisfactory answer on how Homeyscript users should deal with this.

> [@Local time in HomeyScript](https://community.homey.app/t/local-time-in-homeyscript/33338/11):
>
> Hey! It seems my local time is broken again in v5. Do you have any ideas on how to fix my script again?

---

<div class="post-metadata">

**Author:** ![janrikard](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/janrikard/32/34785_2.png) [@janrikard](https://community.homey.app/u/janrikard)\
**Post date:** [November 19, 2023, 1:17pm UTC](https://community.homey.app/t/problem-with-hour/95067/3 "2023-11-19T13:17:45Z")

</div>

Thanks.

That sucks

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [November 19, 2023, 5:06pm UTC](https://community.homey.app/t/problem-with-hour/95067/4 "2023-11-19T17:06:20Z")

</div>

> [@janrikard](#):
>
> gives a tag with diffrent time-stuff as a number-tag, for example current hour.

Better logic library has this onboard already?

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/3/f3db68a2434d5d5b1931d6470c1246226208b4ff.png)

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/4/341a90f3f7fd8993510a90b49a83d6611b0c87f0.png)

> [@The Flow Exchange(r) - Exchange Your Flows with Others!](https://community.homey.app/t/the-flow-exchange-r-exchange-your-flows-with-others/68981/72):
>
> Time Calculator With the re-invented Better Logic Library app, we can calculate with time a bit easier without Homeyscript. Apps used: [Better Logic Library](https://homey.app/a/net.i-dev.betterlogic)Other things people need to do to get it working correct? Any questions can be asked in this topic: [https://community.homey.app/t/app-pro-better-logic-library-for-users/71876](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876) TEF: [tef:FLOWS:"H4sIAAAAAAACA7VayXIbyRH9FUbHHGYiVHLtC472ZQ7jk3wjGYxasiiEsd…
