Converting "5/22/2012 12:00:00 AM" to a DateTime

curiouswebster used Ask the Experts™
Are there any built in ways to make this conversion?  Or any code I can grab and make into an extension method?

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
use CAST or CONVERT functions
CONVERT(datetime, '5/22/2012 12:00:00 AM', 120)
PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

Sorry, use Convert.ToDateTime("5/22/2012 12:00:00 AM");
ignore first 3 posts - I thought you were using SQL Server.  In C# just use Convert.ToDateTime

DateTime mydate=Convert.ToDateTime("5/22/2012 12:00:00 AM");
curiouswebsterSoftware Engineer



Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial