Live data from Hacker News

Show HN: Convert English to Cron Expressions

cronprompt.com

21–30 of 61 posts

Re: Show HN: Convert English to Cron Expressions

#21

Great, using "never" as prompt results in: "At 12:00 AM, on day 31 of the month, only in February"

In some contexts it is a legal requirement to treat the date February 29th in a non-leap-year as March 1st.

Not precisely related, just a go-to "they've thought of that" anecdote for when people are underestimating how thorough the law can be.

Re: Show HN: Convert English to Cron Expressions

#22

It's erroring out on me but I wanted to try one of my stackoverflow questions from long ago that still gets frequent votes: Every 15 minutes except at 3AM? Stackoverflow responses say it can't be done in one line.

Ah it finally worked: 0-59/15 3 * * *') Is this correct? :)

Re: Show HN: Convert English to Cron Expressions

#23
post #6

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"

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 *

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

#25

It's erroring out on me but I wanted to try one of my stackoverflow questions from long ago that still gets frequent votes: Every 15 minutes except at 3AM? Stackoverflow responses say it can't be done in one line.

Ah it finally worked: 0-59/15 3 * * *') Is this correct? :)

[deleted]

Re: Show HN: Convert English to Cron Expressions

#26

It's erroring out on me but I wanted to try one of my stackoverflow questions from long ago that still gets frequent votes: Every 15 minutes except at 3AM? Stackoverflow responses say it can't be done in one line.

Ah it finally worked: 0-59/15 3 * * *') Is this correct? :)

There is a trailing ') from a bug that I just fixed. I don't think that's correct. Tricky prompt!

Re: Show HN: Convert English to Cron Expressions

#29

Great, using "never" as prompt results in: "At 12:00 AM, on day 31 of the month, only in February"

In some contexts it is a legal requirement to treat the date February 29th in a non-leap-year as March 1st. Not precisely related, just a go-to "they've thought of that" anecdote for when people are underestimating how thorough the law can be.

Often people want to treat the law as if it were computer code, but fortunately sometimes it's more like the grade-school teacher making sure that the kids play nicely together.

Re: Show HN: Convert English to Cron Expressions

#30

It's erroring out on me but I wanted to try one of my stackoverflow questions from long ago that still gets frequent votes: Every 15 minutes except at 3AM? Stackoverflow responses say it can't be done in one line.

If you mean to only skip one specific occurrence at 03:00 exactly then, yes, it can’t be done in a single line.
Post reply on HN