If no time is specified in the line that was analyzed, the TimeOfDay property of the DateTime object will be set at midnight (00:00:00). Then you can check if this case has something like this:
if (dt1.TimeOfDay.Equals(new TimeSpan(0,0,0))) { //do something } else { //do something else }
EDIT: Another approach might be to separate the date and time strings of a string. This assumes that some type of numeric date format is passed using dashes, commas, or anything other than spaces.
string[] dateString = str1.Split(' '); string[] date2String = str2.Split(' ');
You will now have a string array that you can easily use to check for special values. dateString[0] , for example, should contain all of your date. dateString[1] and onwards will have any time formats and can be recombined and analyzed into a TimeSpan object. Obviously, if there is only one entity in the array, they have not entered at any time.
source share