cRonstrue icon indicating copy to clipboard operation
cRonstrue copied to clipboard

Incorrect leading zero in 12-hour time

Open JasonWeill opened this issue 1 year ago • 1 comments

Thanks for all the great work on cRonstrue!

I noticed that when a time in 24-hour format is converted to 12-hour format, it still has a leading zero: 16:51 or 51 16 * * * becomes 04:51 PM. The leading zero for hours is used in 24-hour time (e.g., 04:51 for 4:51 AM) but not in 12-hour time. I would expect 16:51 to be translated as 4:51 PM.

JasonWeill avatar Oct 08 '22 00:10 JasonWeill

Hi @jweill-aws - I've seen requests for both formats and I think ISO 8601 (at least) calls for leading zeros. Regardless, adding an option for this could be useful.

Related: https://github.com/bradymholt/cRonstrue/issues/217

bradymholt avatar Oct 10 '22 14:10 bradymholt