News for hackers. Stuff that matters.
Re:Show HN: Convert English to Cron Expressions by gfaster on Friday August 05, 2022 @01:27PM (#32359177)
This is pretty great. It would be nice if it were able to handle exceptions, for example:

"The second Sunday of every month except in December"

Re:Show HN: Convert English to Cron Expressions by jacobpedd on Friday August 05, 2022 @01:43PM (#32359381)
I added your example to the training data and it seems like it helped it learn exceptions. Here's the result for your prompt:

0 0 8-14 1-4,6-12 *

Re:Show HN: Convert English to Cron Expressions by cuu508 on Friday August 05, 2022 @02:09PM (#32359731)
But that expression doesn't seem to make sense, no?

IMO it should generate something like: "0 0 * 1-11 SUN#2"

The "#2" bit is not standard cron syntax though and will not work correctly in e.g. Debian cron.

Re:Show HN: Convert English to Cron Expressions by jacobpedd on Friday August 05, 2022 @04:51PM (#32361833)
You’re totally right. Missed the the second Sunday part.

Wasn’t aware of the SUN#2 syntax. I find it interesting it used 8,14 as its best approximation. You can see it trying it’s best.