How to run pg_cron job as per local time?

Viewed 22

Currently pg_cron works as per UTC/ GMT time only. There is no configuration option available to run job as per local time server time. How to run pg_cron job as per local time?

1 Answers

When you define cronjob with pg_cron you can set first the timezone

SELECT cron.schedule('manual vacuum', '0 22 * * *', 'SET LOCAL TIME ZONE \'Europe/Rome\'; VACUUM FREEZE pgbench_accounts');
Related