Search code examples
javascriptfirebasecronschedule

hourly cron task overlapping on 2 days


I have to write some cron expressions from a firebase schedule function. As Google's servers aren't in the same timezone as me I will have to convert my existing expressions. (from UTC+2 to UTC-5). Here is an example of one of my expressions: 0 9-17 * * 1-5 - from monday to friday at minute 0 from 9:00 to 17:00

How can I convert this so it will run at this time in UTC+2 when the server is in UTC-5


Solution

  • Because UTC+2 to UTC-5 is 7 hours backwards you should take the time 7 hours backwards:

    0 2-10 * * 1-5