Locations
Run calendar schedules in the intended time zone
Set a schedule location
Use WithLocation when a cron schedule should be evaluated in a specific time
zone.
scheduler.ScheduleWithCron(func(ctx context.Context) {
println("close daily accounting window")
}, "0 0 18 * * *", chrono.WithLocation("America/New_York"))This is useful when the process runs in one environment but the schedule belongs to a business region, customer region, or operational time zone.
Keep time zones visible
Prefer passing the location near the schedule definition. Future readers can see both the cron expression and the time zone in the same place.
location := chrono.WithLocation("Europe/Istanbul")
scheduler.ScheduleWithCron(func(ctx context.Context) {
println("send local summary")
}, "0 45 18 * * *", location)