DateInvalidTimeZoneException: Unknown or Bad Timezone Error (Asia/Calcutta)

Hi,

I’m encountering an issue related to the timezone settings on my Nextcloud instance. Here are the details of the error:

DateInvalidTimeZoneException
DateTimeZone::__construct(): Unknown or bad timezone (Asia/Calcutta)
Error while running background job OCA\DAV\BackgroundJob\EventReminderJob (id: 12, arguments: null)

It seems like the timezone “Asia/Calcutta” is being flagged as unknown or incorrect. I’ve double-checked my configuration, and “Asia/Kolkata” is the correct and recognized timezone in PHP and most systems now, replacing “Asia/Calcutta.”

Could this be the source of the issue? If so, how can I update the timezone for my instance or background jobs to resolve this? Any guidance or suggestions would be appreciated.

Thanks in advance!

You could try adding the following line to the config.php, or change it accordingly if it’s already there:

'default_timezone' => 'Asia/Kolkata'

See also here: Configuration Parameters — Nextcloud latest Administration Manual latest documentation

And you should probably also change it accordingly in the respective php.ini files on your system: PHP Modules & Configuration — Nextcloud latest Administration Manual latest documentation

Are you perhaps not running on an LTS release of Debian (or similar)?

I believe you can install the package tzdata-legacy or similar.

1 Like

Hello Jtr
I wanted to share an update regarding the time zone issues we were facing. By running the command tzdata-legacy, the problem has been successfully fixed.

Thank you

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.