I need to convert a .Net DateTime object created using a full date and
military time string like so:

DateTime StartDate = Convert.ToDateTime("06/26/2003 09:00:00");
or
DateTime StartDate = Convert.ToDateTime("06/26/2003 21:00:03");

to a format that I can use to easily stuff in an Oracle database like so:
(Without resorting to Oracle TO_DATE formatting of a string)

cmd.Parameters.Add("p_scheduled_start_date", StartDate);
cmd.Parameters[1].OracleType = OracleType.DateTime;

I receive a input string error which tells me that the OracleType.DateTime
enum can't handle the military formatted DateTime.

If I generate the DateTime using:

DateTime StartDate = Convert.ToDateTime("04/22/2003 10:00:00 AM");
Which I believe happens to be the "default" DateTime string format, all is
well.

It appears that there isn't a standard format to produce the
("04/22/2003 10:00:00 AM") format I think I need.

How do I convert the internal format to the format I need? Do I need a
custom formatter? Or something else?

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com
NEW! ASP.NET courses you may be interested in:

2 Days of ASP.NET, 29 Sept 2003, in Redmond
http://www.develop.com/courses/2daspdotnet

Guerrilla ASP.NET, 13 Oct 2003, in Boston
http://www.develop.com/courses/gaspdotnet

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to