I am working on a program that requires the date of an event to get returned.
I am looking for a Date, not a DateTime.
Is there a datatype that returns just the date?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No there isn’t.
DateTimerepresents some point in time that is composed of a date and a time. However, you can retrieve the date part via theDateproperty (which is anotherDateTimewith the time set to00:00:00).And you can retrieve individual date properties via
Day,MonthandYear.UPDATE: In .NET 6 the types
DateOnlyandTimeOnlyare introduced that represent just a date or just a time.