Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# Data type for Birthdate

Tags:

date

c#

types

There is no Date type. If I want an object that is only a date with no time, like a birthdate, what type would I use?

I'm sure this question has been asked and answered already, but I'm not finding this exact question, only lots about date and datetime in general.

Thanks!

(Edit: I am not asking how to remove the date, or the time, from a DateTime. I was hoping that there might be a data type that stores ONLY date, and not a date and a time together. The answer, it seems, is No.)

like image 544
Casey Crookston Avatar asked Sep 28 '22 09:09

Casey Crookston


1 Answers

There is no just Date type, use the DateTime data type and only set the date, the time will be all 0s.

like image 65
GregoryHouseMD Avatar answered Oct 03 '22 07:10

GregoryHouseMD