I get unexpected results when I use DateTime.ParseExact. Here\'s my test code:
Dim MinVal As DateTime = #12:00:01 AM# Dim MaxVal As DateTime = #11:59:59 PM#
Documentation states:
If format defines a time with no date element and the parse operation succeeds, the resulting DateTime value has a date of DateTime.Now.Date.
DateTime.Now.Date
If you want a time with no date, you can use:
var parsedDate = DateTime.ParseExact(...); var timeOnly = parsedDate - parsedDate.Date;