Skip to content

Are there any Javascript or PHP libraries or packages to help AWS cron expressions?

When you create EventBridge or CloudWatch rules in AWS, you use Schedule Expressions. There are two types:

  • Cron Expressions
  • Rate Expressions

When creating cron expressions (below figure is on CloudWatch service), you can see the next 10 Trigger Dates on the console. Is there a library or code snippet provided by AWS that allows you to parse the cron expression and display the trigger dates (past and future)?

AWS Cron Expression

Answer

I ended up using cron-parser as suggested by Marcin. Worked out pretty well.