Comparing dates - earlier/later

Cdate(string) or Convert.ToDateTime(string) are equal. But as mentioned elsewhere in this forum, the negatives from using that method is that it assumes the date format is always Month/day/year in that order so “dd/MM/yyyy” will give wrong results.

I typically use Cdate(“9/1/2017”).ToString(“MM/dd/yyyy”) for formatting (for example) and that works fine, but Parse is probably more reliable in the long run for handling dates internationally.

Just my 2 cents

4 Likes