No, you cannot override static methods. But you can write your own static method:
public static class MoreConvert
{
public static DateTime? ToDateTimeOrNull(string text)
{
return text == null ? (DateTime?) null : Convert.ToDateTime(text);
}
}
Note that the return type must be DateTime?, because it is DateTimeitself a value type that is not null.
DateTime.ParseExact Convert.ToDateTime - , - . , . ? ? ( , - ?)