# Time calculation from sun down time to end time to show seconds countdown for turn off lights and show time on dashboard

**URL:** <https://community.homey.app/t/time-calculation-from-sun-down-time-to-end-time-to-show-seconds-countdown-for-turn-off-lights-and-show-time-on-dashboard/96134>\
**Category:** Questions & Help\
**Tags:** app, dashboard, homey-pro, local-time\
**Created:** [November 28, 2023, 7:43pm UTC](https://community.homey.app/t/time-calculation-from-sun-down-time-to-end-time-to-show-seconds-countdown-for-turn-off-lights-and-show-time-on-dashboard/96134 "2023-11-28T19:43:19Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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 29, 2023, 2:53am UTC](https://community.homey.app/t/time-calculation-from-sun-down-time-to-end-time-to-show-seconds-countdown-for-turn-off-lights-and-show-time-on-dashboard/96134/2 "2023-11-29T02:53:24Z")

</div>

Better Logic Library can help here

> [@\[APP\]\[Pro\] Better Logic Library - For Users](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/100):
>
> BLL expressions within any text (variable) I am having more and more fun with BLL. The below was not obvious to me so I share here the power of the BLL card “Set variable to text”. [image] This means you can add one or more texts and BLL expressions into any text variable, pass the variable to a central flow where you process it with a single BLL card. This saves (me) several formatting cards in various flows.

> [@\[APP\]\[Pro\] Better Logic Library - For Users](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/28):
>
> Well, you can kind off, but not in the easy ‘formatting’ way: because i didn’t find a all-around solutions independend of locale and timezone. date('DATETIME', null, 'en') You will get a tag, you can use the last number if it’s like this. But if you get this, you will probably get the same result as me: So, the complete solution would be: new Date().setHours(18-Number.parseInt(\_.last(date('DATETIME', null, 'en'))),0,0,0) - Date.now() \< 15\*60\*1000; (this is true when less the…

> [@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…

---

_[View the full topic](https://community.homey.app/t/time-calculation-from-sun-down-time-to-end-time-to-show-seconds-countdown-for-turn-off-lights-and-show-time-on-dashboard/96134)._
