Oracle Function & .NET sysdate problem

After I shared one solution about oracle, iis and sysdate problem, I got another similar error. This time, the function was getting the paramater sysdate with time added. I noticed this because the function was calculating default insterest of a price, and each hour it was increasing the total amoun.

After many tries, I removed NS_LANG key from reg entry of Oracle. See below.


If it doesnt work, try to add your language and setting, Turkish in my case.


#ns_lang, #oracle, #sysdate

Oracle sysdate year problem

I have been trying to solve the problem that I encounter when I call a Oracle function in my code. Oracle function takes one number and date as parameteres:


And I was calling the function in my code like


This code is already a wrong approach; trying to convert sysdate which is already a date to a date. I couldn’t change it as it is used by many other applications. But the same code above gave different results in different servers. I realized that the problem was the date format. That is to say how server interprets sysdate parameter of oracle.

When I called to_date(sysdate) (select to_date(sysdate) from dual;) I got 09.12.2015 normally but in a new server I got 09.12.0015 which caused problem for my oracle function.

I thought that as it is an Oracle term, sysdate gave the current datetime from Oracle server but it was not.

Depending on the client server’s settings, the date format might differ. There are two options you can do: Continue reading