Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Timezone region not found

I'm creating a C# MVC project that uses Oracle Database. While trying to connect to the DB, I get following error:

ORA-00604: error occurred at recursive SQL level 1
ORA-01882: timezone region not found.

enter image description here

When I try to connect via SQL developer it works fine. Is there any way that I can solve this problem ?

NOTE: I'm using IIS express for testing

like image 666
Sandaru Avatar asked Sep 12 '25 15:09

Sandaru


2 Answers

I was facing the same issue using ODP.NET for .NET Core on Pivotal Cloud Foundry. The core issue is missing timezone information.

Added a timezone by setting "TZ" environment variable for my instance. That fixed the issue for me.

like image 158
BBC Avatar answered Sep 14 '25 04:09

BBC


According to this straight from an Oracle employee, set UseHourOffsetForUnsupportedTimezone property for the Connection to true, before opening it.

con.UseHourOffsetForUnsupportedTimezone = true;
con.Open();

This worked for me as I did not have control on the OracleDB server, and in my crossplatform application, the environment variable usage was not being consistent across linux distros. I had ran Weinfried's snippet on all of them to test and there was no timezone descrepency with OracleDB in my case(both on UTC, no DST) but was still failing on the same plank.

like image 31
Arindam B Avatar answered Sep 14 '25 03:09

Arindam B