asp.net core get current datetime code example Example: c# get current date DateTime now = DateTime.Now;