redpanda-data / connect

Fancy stream processing made operationally mundane
https://docs.redpanda.com/redpanda-connect/about/
8.13k stars 837 forks source link

Set time zone to interval #759

Open ShuoZhang03 opened 3 years ago

ShuoZhang03 commented 3 years ago

interval: 0 2 1 I want to run a task at two o'clock on the first of every month,but the task run with UTC time ,i am in CST time zone,8 hours faster than UTC。Can i set Set time zone to interval ? I try 'CRON_TZ=CST 0 2 1 ' ,but it can't support。

Jeffail commented 3 years ago

Hey @ZSiHM, it doesn't seem to be documented but it looks as though you can specify a timezone with TZ=CST 0 2 1 * *.

ShuoZhang03 commented 3 years ago

Hey @Jeffail ,I have tried TZ=CST 0 2 1 ,but it does not work,Notice unknown time zone CST,the same as JST,GST,CCT.Can you provide a list of supported time zones,thank you!

Jeffail commented 3 years ago

Hey @ZSiHM, looks like it uses https://golang.org/pkg/time/#LoadLocation under the hood, which in turn references the IANA Time Zone database, so you need to provide a location name like "America/New_York". For CST I think you'd want one: America/Belize, America/Costa_Rica, America/El_Salvador, America/Guatemala, America/Managua, America/Regina, America/Swift_Current and America/Tegucigalpa.