sunpaper icon indicating copy to clipboard operation
sunpaper copied to clipboard

invalid date

Open snauth opened this issue 1 year ago • 3 comments

After changing the lat/lon to

latitude="63.4263N"
longitude="10.4036E"

(now you know where I live :-))

I get:

date: invalid date ‘--:-- (Midnight sun)’
date: invalid date ‘--:-- (Midnight sun) 15 minutes’
date: invalid date ‘--:-- (Midnight sun) 30 minutes’
date: invalid date ‘--:-- (Midnight sun) 90 minutes’
date: invalid date ‘--:-- (Midnight sun) 90 minutes ago’
date: invalid date ‘--:-- (Midnight sun) 30 minutes ago’
date: invalid date ‘--:-- (Midnight sun) 15 minutes ago’
date: invalid date ‘--:-- (Midnight sun)’
./sunpaper.sh: line 357: [: : integer expression expected
./sunpaper.sh: line 365: [: : integer expression expected
./sunpaper.sh: line 373: [: : integer expression expected
./sunpaper.sh: line 381: [: : integer expression expected
./sunpaper.sh: line 389: [: : integer expression expected
./sunpaper.sh: line 397: [: : integer expression expected
./sunpaper.sh: line 405: [: : integer expression expected

snauth avatar May 26 '23 12:05 snauth

Fixed it by switching from "civil" to "gmt" in the sunwait command. "civil" resulted in an empty date.

snauth avatar May 26 '23 13:05 snauth

oh wow you live in a place with no date/time! ... congratulations?

I've confirmed the issue here with sunwait. It looks like several of the "twilight types" options aren't returning a value at your location (civil, nautical, astronomical). The default daylight twilight type is returning a value, however sunwait list daylight rise 63.4263N 10.403W I think gmt minor option is just working for you because it's using the "daylight" default time.

Using the daylight type will work but your sun transitions might be a bit visually off from what's going on outside. A daylight twilight is when the top of the sun is just below the horizon. A civil twilight is -6 degrees below the horizon.

I'll dig deeper into the sunwait issue to see if it's a bug with that program or something wrong with my implementation.

hexive avatar May 26 '23 13:05 hexive

Yes, life here is pretty relaxed :-) And I can live with times slightly off. Thanks for looking into this!

snauth avatar May 27 '23 10:05 snauth