[Remind-Fans] accepting dates/times in more English format

Ian! D. Allen idallen at idallen.ca
Thu Jan 17 12:51:49 EST 2019


> Are you good with perl?

I am, but that's not what I asked for.  As I said, date(1) does the job just fine outside of Remind, if I have to convert manually (see below).  I wanted to just paste the table into Remind and add some stuff around it.  Can't be done.  (Maybe I'll write a dateconv() function patch for Remind some day.)


On Thu, Jan 17, 2019 at 11:52:37AM -0500, Dianne Skoll wrote:
> perl -ane 'print "REM $F[0] $F[1] AT $F[2] MSG " . join(" ", @F[3..$#F]) . "\n"'

The above doesn't handle the conversion from UTC to local, which is why I showed the necessary use of tzconvert in my example:

     REM [tzconvert(dateconv("Jan 21 2019 19:59"),"UTC")] FOO

You'd need to use even more Perl to handle the TZ conversion as well as the format conversion.  Not worth it.

If I tack on "UTC" to the input dates, the GNU date(1) command can do it all with far less messing about:

    $ echo "Jan 21 19:59 UTC" | date -f - +'%F@%R'
    2019-01-21 at 14:59

-- 
| Ian! D. Allen, BA, MMath  -  idallen at idallen.ca - Ottawa, Ontario, Canada
| Home: http://idallen.com/  Contact Improv Dance: http://contactimprov.ca/
| College professor (Free/Libre GNU+Linux) at: http://teaching.idallen.com/
| Defend digital freedom:  http://eff.org/  and have fun:  http://fools.ca/


More information about the Remind-fans mailing list