On Wed, 4 Sep 2013, gsker wrote:

> Yeah sorta fun.
>
> It's much easier on the brain if you just use the Date and don't get 
> excited about minutes.

I thought time zones were the more annoying problem.


> And, unless you know the minutes for the bd and the obd, minutes really 
> don't matter.
>
>
> #Birthday:
>  bd="15 Sep 1969"
> #Offspring Birthday:
>  obd="18 Sep 2007"
> # convenient alias
> alias d='date +%s --date '
>
> # twice the obd + bd
> date --date @$((  2* $(d "$obd") - $(d "$bd") )) +%c
>
> Wed Sep 20 00:00:00 CDT 2045

I like your use of (( )).  I tried to do something with that and I 
couldn't get it to work, so I obviously was doing it wrong.

The problem I was having with the simpler approach was that daylight 
savings was causing me to get some at 23:00 the previous day instead of at 
00:00 on the "right" day.  For example, change "bd" above to 15 Mar 1969.

$ bd="15 Mar 1969"
$ date --date @$((  2* $(d "$obd") - $(d "$bd") )) +%c
Thu 22 Mar 2046 11:00:00 PM CDT

After awhile I just decided to go all out with the time zones and try to 
make it work right.  I think I figured out the tricks to that.  I would 
like to make a web page some day that allows people to do these kinds of 
calculations, probably with dropdown menus for time zones and the time of 
day set to noon by default.  I would need to learn how to make that kind 
of website very secure in case it gets attacked.

Mike