How to change the Datatime format in C#?

Asked

Viewed 122 times

1

I get a string with the date, put that string in a DateTime, and put this DateTime in a bank variable.

The problem is that the database variable uses a different format than DateTime (Mmddyyyy), and the DateTime of C# uses the format (ddMMyyyy).

I need to change this via code, and I don’t know how.

Use Firebird database, ODBC drive. Visual Studio 2013.

1 answer

1

Try to make the conversion:

DateTime.Now.ToString("MM/dd/yyyy");

Browser other questions tagged

You are not signed in. Login or sign up in order to post.