[Remind-Fans] Calculate timediff to next occuring timed event

Paul Pelzl pelzlpj at eecs.umich.edu
Tue Nov 8 15:29:52 EST 2005


On Tue, Nov 08, 2005 at 08:37:51PM +0000, Oliver wrote:
> Does anybody has a hint, how to parse the time for the next occuring
> event? To calculate the timediff between now and the event will be
> other scripting stuff I guess.

This requires a bit of scripting.  "rem -s -g" has the information you
need; you can pull out the date (the 1st field) and the start time (the
5th field) of each reminder, and find the first reminder falling after
the current time.  If you use an option like "-s+16" then you should
catch the next reminder as long as it falls within the next 16 weeks.

Of course, this is a good time for me to prod David to merge my patch
that adds "simple calendar"-style fields to the output of "rem -n".
That would be ideal for this task.  (Email me off-list if you want a
copy of the patch.)

*prods David* ;-)

Paul






More information about the Remind-fans mailing list