Hi here we can do it in two ways,
1) Keep in mind that you can hard-code ISO format
string formatForMySql = dateValue.ToString("yyyy-MM-dd hh:mm");
or use next:
// just to shorten the code
var isoDateTimeFormat = CultureInfo.InvariantCulture.DataTimeFormat;
// "1976-04-12T22:10:00"
dateValue.ToString(isoDateTimeFormat.SortableDateTimePattern);
// "1976-04-12 22:10:00Z"
dateValue.ToString(isoDateTimeFormat.UniversalSortableDateTimePattern)
and so on
Now, when you need it in your specific format, you can then reverse the process, i.e.: