Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

checking a Date type has a value

Status
Not open for further replies.

rotsey

Programmer
Nov 23, 2004
135
AU
HI,

HOw do you check if a date type has a value??

Because it seems to have tostring value of
"1/01/0001 12:00:00 AM".

Is that what you check for?? Seems odd

rotsey
 
That is the default value that is assigned to a date variable so it will equal the string "1/01/0001 12:00:00 AM" if it hasn't been changed.

--------------------------------------------------------------------------------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
ok thanks

if you don't use tostring the value is

#12:00:00 am#

rotsey
 
Or use the static/shared constant that's provided by the DateTime structure: MinValue. This corresponds to 1/1/0001, but is part of the framework, so your program isn't cluttered with constants that you (might) have mistyped.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top