In my console application, I am trying to format to HHmmss - HHmmss I'm sure this is related to my data types, but how can I be NULL when NULL and not display 1/1/0001 12:00:00 AM ?
This is my syntax
public static DateTime fmtLST; public static string LST = null; if (LST != null) { IFormatProvider format = System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat; fmtLST = DateTime.ParseExact(LST, "HHmmss", format); } Console.WriteLine(fmtLST.ToString("hh:mm:ss tt"));
If changed to public static DateTime? fmtLastScanTime; public static DateTime? fmtLastScanTime; I get an error
'No overload for' ToString 'method takes 1 argument
How can I use this NULL screen instead of 1/1/0001 12:00:00 AM ? Trying to take readings 1/1/0001 12:00:00 AM
source share