# Calculate time between sun down and 00:00 in decimal value

**URL:** <https://community.homey.app/t/calculate-time-between-sun-down-and-00-00-in-decimal-value/71308>\
**Category:** Questions & Help\
**Tags:** homey-pro\
**Created:** [October 28, 2022, 8:49am UTC](https://community.homey.app/t/calculate-time-between-sun-down-and-00-00-in-decimal-value/71308 "2022-10-28T08:49:51Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Marcel\_Ubels](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marcel_ubels/32/18860_2.png) [@Marcel\_Ubels](https://community.homey.app/u/Marcel_Ubels)\
**Post date:** [October 28, 2022, 10:09am UTC](https://community.homey.app/t/calculate-time-between-sun-down-and-00-00-in-decimal-value/71308/2 "2022-10-28T10:09:18Z")

</div>

Maybe you can use a part of my script. I use the api for getting the total minutes of daylight. But when you have the time for Sunrise or Sunset you can calculate the minutes till 0:00.  
[Solar panels prognose with daylight minutes](https://community.homey.app/t/zonnepanelen-prognose-script-voor-de-solar-edge-omvormer-op-basis-minuten-daglicht-historie/68773)

This is the api call:

url = (‘[https://api.sunrise-sunset.org/json?lat='+latitude](https://api.sunrise-sunset.org/json?lat='+latitude) +’&lng=‘+longitude +’&date=’ + currentYear + ‘-’ + currentMonth + ‘-’ +count +‘&formatted=0’);

Just take a look at the website sunrise sunset  
[Website Sunrise Sunset](https://www.sunrisesunset.com/)

---

_[View the full topic](https://community.homey.app/t/calculate-time-between-sun-down-and-00-00-in-decimal-value/71308)._
