Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: Sun Clock: a 24hr clock that shows the position of the sun (sunclock.net)
45 points by perilunar on July 13, 2022 | hide | past | favorite | 23 comments


Sun Clock is a 24-hour clock that displays the position of the sun, and sunrise, solar noon, sunset, golden hour, and twilight times for your current location. It also shows the current position and phase of the moon, and its rising and setting times.


I’m stoked by the Solar Dial face on my iWatch.

Shows time of nautical and civil dawn and dusk, sun rise and set, length of day, and time before and after those various events.


That's partly the inspiration for this. I don't have an iWatch but wanted something similar for my phone and desktop.

Good article on the Solar Face: https://www.hodinkee.com/articles/the-eerie-beauty-of-the-ap...

I also wanted to do an elliptical horizon like astronomical clocks (https://en.wikipedia.org/wiki/Astronomical_clock), but did the "simplest thing that works" first.


Great work! There's a long history of similar dials listed at https://24hourtime.info/ - perhaps yours can be added there!


I love this kind of thing. I’m looking forward to your next version!


Interesting! That's similar to a clock that my brother and I made years ago (http://naturalclock.net). Ours adds the altitude of the sun throughout the day and lets you select the location and fast forward and rewind time to see how the sun's path changes throughout the year. I came up with the basic concept and my brother drastically improved the graphics and added the map and retrieval of time zones. Unfortunately no documentation and no HTTPS. I don't know how accurate it is. As I recall we based the equations for the sun on a solar cell-related website.

It's cool that the Sun Clock has the moon phases and that the sun (according to another comment) goes the correct way in the Southern Hemisphere. I kind of wanted to add the moon but hadn't thought about the position of the sun.


https://play.google.com/store/apps/details?id=info.staticfre... is a widget for Android and very neat (though it doesn't properly cache location) https://github.com/xxv/24hAnalogWidget




Thanks!


Apologies if this is a dumb question, but why does it go anticlockwise?


Not a dumb question — it's one of the reasons I built this. It's because you are in the Southern Hemisphere.

In the Southern Hemisphere the Sun is generally in the northern half of the sky at midday (although not always if north of the Tropic of Capricorn), and the sun appears to move anticlockwise across the sky. If you are facing North sunrise (East) is to your right and sunset (West) is to your left, and the hour hand of the clock pretty much tracks the position of the sun.


Thanks!


this is so good, i love it! some soft radial gradient roughly matching the sum would be pretty, but then the twilight edges are hard to distinguish…


There's a gradient that you see briefly before the location loads, or for longer if you don't give location permission. I think it looks nicer than the end result, but you do need the edges between the periods to be clear.


"Location error: User denied Geolocation"

There was a SunClock for the OpenLook toolkit. It worked (not like the above one) and it looked much better.


> User denied Geolocation

The clock needs a location to calculate sunrise, sunset, and twilight times. You can set one manually in settings if you don't want to permit the browser to use the geolocation API.


love it! as a kid I never understood why we used 12 hours clock instead of 24 hours.

12hours is not a natural cycle


Where's night? Does 'twilight' include night? I thought that it was a separate phase before/after night?

e.g., comparing the clock to the diagram at https://www.weather.gov/lmk/twilight-types, night seems to be missing.


The place I'm currently in is not currently experiencing night. This may also be true for you.


As in, the Sun stays above 18 degrees below the horizon all night?


Yes. If you are north of ~52.3° you won't experience 'true' night at the moment, just astronomical twilight. Of course the definitions are somewhat arbitrary.


Thanks :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: