Karatas, FERHAT
I would love to change the world, but they won't give me the source code!
ORA-01843: not a valid month
6.10.2006 15:35:50 - Filed under : Oracle
"ORA-01843: not a valid month" or
"ORA-01830: date format picture ends before converting entire input string"

This error means that a date was used in the SQL but that Oracle did not consider the month to be a valid month.

False ;
AUDIT_MODIFY_DATE >= to_date('9/19/2006 3:13:10 PM','DD/MM/YYYY HH24:MI:SS')

True ;
AUDIT_MODIFY_DATE >= to_date('19/9/2006 3:13:10 PM','DD/MM/YYYY HH24:MI:SS')

when you use casting operation at datetime data like this:

DateTime lastActionDate = DateTime.Now;
lastActionDate = (DateTime)ds.Tables[0].Rows[0]["CREATEDATE"];

you may set your regional settings for datetime pattern at codebehind.

DateTimeFormatInfo.ShortDatePattern Property gets or sets the format pattern for a short date value.
At this time you can use below statements at top of your method :

CultureInfo c = new CultureInfo("tr-TR") ;
System.Threading.Thread.CurrentThread.CurrentCulture = c;
System.Threading.Thread.CurrentThread.CurrentUICulture = c;
ShortDatePattern = "dd/MM/yyyy";

Related Terminology : Oracle datetime problem, CurrentCulture, CurrentUICulture
with 0 comments

What do you think ?
Security Code 7525
Check S. Code
Home Page