Im looking to convert a DateTime to an Oracle DateTime (to pass to an Oracle stored proc.) I was thinking of using what's below in a general conversions class I have but I'm not sure how to return the converted date, could anyone kick me in the right direction?

thanks

public static explicit operator OracleDateTime(DateTime dt)
有帮助吗?

解决方案

Well that operator means you can just cast:

DateTime input = new DateTime(...);
OracleDateTime result = (OracleDateTime) input;
...

It's not clear what you mean by "how to return the converted date" - it's not like you'd want a method for this, given that it's already been implemented for you.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top