[Remind-Fans] Faking the time zone (was Re: sun moon data)

Dougie Lawson dl1ims at gmail.com
Thu Mar 17 20:11:28 EDT 2022


Hi Dianne,

One bit of code I like is https://github.com/risacher/sunwait
I use that to get a crontab based process to wait for dusk or dawn (at my
lat/long). It appears to get the maths right for that.

It's run with
45 4 * * * root /usr/local/bin/sunwait civ up +0:00:00 51.200000N 1.134000W
; /usr/local/bin/sunny.sh light;
30 15 * * * root /usr/local/bin/sunwait civ down -0:00:00 51.200000N
1.134000W ; /usr/local/bin/sunny.sh dark;

Note: I've changed my lat/long to avoid publishing my exact (captured with
GPS) location.

The sunny script then runs the processes that need to happen at civil dawn
or dusk.

Running  sunwait -p  51.200000N 1.1343000W emits these data

Using location:             51.200000N, 1.134000W
Date:                       17 Mar 2022
Local time:                 23:59
Day length:                 12:05 hours
With civil twilight         13:08 hours
With nautical twilight      14:26 hours
With astronomical twilight  15:47 hours
Length of twilight:  civil   0:31 hours
                  nautical   1:10 hours
              astronomical   1:50 hours
Current specified time zone: UTC (0 from UTC)
Sun transits meridian 1212 UTC
                   Sun rises 0611 UTC, sets 1813 UTC
       Civil twilight starts 0538 UTC, ends 1846 UTC
    Nautical twilight starts 0459 UTC, ends 1925 UTC
Astronomical twilight starts 0419 UTC, ends 2006 UTC


I've built Remind with the same lat/long values hard coded in
../src/custom.h (having run them through a co-ord converter to convert from
ddd°.dddd to dd°, mm', ss".
Running that with this reminder:


MSG sunrise at [sunrise(trigdate())], sunset at [sunset(trigdate())], next
full moon at [moontime(2)] on [moondate(2)]%


gets this output

Reminders for Friday, 18th March, 2022 (today):


sunrise at 06:12, sunset at 18:14, next full moon at 07:20 on 2022-03-18

So you're close enough with your solar ephemeris.

Regards, Dougie

On Thu, 17 Mar 2022 at 20:53, Dianne Skoll via Remind-fans <
remind-fans at lists.skoll.ca> wrote:

> On Thu, 17 Mar 2022 11:54:33 -0300
> Sector11 via Remind-fans <remind-fans at lists.skoll.ca> wrote:
>
> > Dianne I feel so silly and:
> > -----
> > faketime -f '+4' remind -q -r ~/.reminders.sun.v
> > -----
> > doesn't work.  :(
>
> No, but:
>
>     TZ=Europe/Berlin remind -q -r ~/.reminders.sun.v
>
> might.
>
> Now I do see that it's off by about 10-12 minutes from
> some sources on the web, so I might need to investigate
> further.
>
> Regards,
>
> Dianne.
> _______________________________________________
> Remind-fans mailing list
> Remind-fans at lists.skoll.ca
> https://dianne.skoll.ca/mailman/listinfo/remind-fans
> Remind is at https://dianne.skoll.ca/projects/remind/
>


-- 
http://twitter.com/DougieLawson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://dianne.skoll.ca/pipermail/remind-fans/attachments/20220318/6c6b4da0/attachment.htm>


More information about the Remind-fans mailing list