/ To mutt-users@mutt.org wrote on Sat 10.Nov'12 at  7:39:33 +0000 /

> / David Champion wrote on Fri  9.Nov'12 at 15:00:44 -0600 /

> > Python option:
> > $ easy_install parsedatetime
> > $ python
> > >>> from parsedatetime.parsedatetime import Calendar
> > >>> import time
> > >>> rfc822format = '%a, %d %b %Y %H:%M:%S -0000'
> > >>> c = Calendar()
> > >>> st, flag = c.parse('next Monday at 2pm')
> > >>> t = time.mktime(st)
> > >>> tm = time.gmtime(t)
> > >>> time.strftime(rfc822format, tm)
> > 'Mon, 12 Nov 2012 20:00:00 -0000'
> > 
> > parsedatetime doesn't know anything about timezones, so the mktime and
> > gmtime are just to adapt the struct_time value from c.parse() from local
> > time to GMT, so that the RFC822 address can assume it.  This lets the
> > script work for anyone, without needing to calculate a zone offset for
> > your locale.
> 
> That's great David, thank you. I had thought about python but i'm still very 
> much in the learning process with it so hadn't got that far. That looks 
> pretty simple, that will give me something to do today. Much appreciation to 
> you both. Jamie.

Just a quick follow-up on this solution you provided for me David: it's
working very well, i'm really pleased with it. I think with a little
more tweaking here and there you should make it available publicly as a
solution for those of us using old fasioned BSD systems. 

Thank you once again for taking the time to write it for me, and the
list users. It's very much appreciated. 

Best wishes, Jamie. 

linewrap=72 columns.

Reply via email to