> Date: 2008-03-05
> Apptmt: Lunch with Sam
> {(set -q xnow = (ftime fmt="%Y") * 365)}
> {(set -q xthen = (ftime fmt="%Y" when={$:Date}) * 365)}
> {(set -q ynow = (ftime fmt="%j"))}
> {(set -q ythen = (ftime fmt="%j" when={$:Date}))}
> {(set -q diff = $xthen + $ythen - $xnow - $ynow)}
> {(echo "Don't forget your appointment ({$:Apptmt}) in $diff days")}

Obviously this doesn't take into account leap year.  Various conditionals
are possible, but I'm guessing not worth the effort...

BTW the problem with doing it all in one line is that (ftime "fmt="%j")
results in something like 057.  Because of the leading 0 it gets interpreted
as an octal.  By the time that problem is solved the multi-line set is
probably easier...

-Peter


_______________________________________________
pmwiki-users mailing list
[email protected]
http://www.pmichaud.com/mailman/listinfo/pmwiki-users

Reply via email to