set datetime as now c# class query code example Example: c# get today's date DateTime today = DateTime.Today;