Skip to main content

Don't Abuse The DateTime Object, It Can Help You If You Try

Just when I thought I’ve seen it all in this codebase I run across this gem.

DateTime low = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);

I’m not sure how this person came to use that instead of DateTime.Now.Date but I guess this is one of those unspoken perks of supporting someone else’s code.

Tagged