c# get date without time
var dateAndTime = DateTime.Now;
var date = dateAndTime.Date;
c# get date without time
var dateAndTime = DateTime.Now;
var date = dateAndTime.Date;
C# date type no time
/*
There is no dedicate pure Date class because you already have DateTime which can handle it.
If you want the standard approach look at the DateTime.Date property which gives just the date
portion of a DateTime with the time value set to 12:00:00 midnight (00:00:00).
E.g. Console.WriteLine($"Date only: {myDateVar.Date}");
*/
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us