C# Format Date for Oracle

Short blog today, below is working C# code I ran today to format and update a date in an Oracle database.
My first attempt using just DateTime.Now resulted in error “ORA-01861: literal does not match format string”.

{!{code}!}czoxNDY6XCINCmNvbW1TUUwuQ29tbWFuZFRleHQgPSBcIlVQREFURSBQb2xsaW5nVGFibGUgXCIgKw0KXCIgU0VUIERBVEVfUE9MTEVEID17WyYqJl19IFwnXCIgKyBEYXRlVGltZS5Ob3cuVG9TdHJpbmcoXCJ5eXl5LU1NLWRkIGhoOm1tOnNzXCIpICsgXCJcJ1wiICsgDQpcIiBXSEVSRSAuLi4gXCI7DXtbJiomXX0KXCI7e1smKiZdfQ=={!{/code}!}

Uncategorized  

Leave a Reply