M
Marc Pelletier
Hello all,
I have a library of datetime routines that make things simpler for me.
Before I discovered DateTime.MinValue I had a function that looked like
public static DateTime DayZero { get { return new DateTime( 0,0,0); } }
I use it to compare for nonvalid datimes in some code, for example if
moonrise equals DayZero then the moon doesn't rise on that day.
Now I am SOOO much smarter and I refer to DateTime.MinValue instead. Is
there a simple way to get the equivalent result for a smalldatetime field?
Right now I am using
public static DateTime SmallDayZero {get {return new DateTime(1900,1,1);} }
to test if a value will fit into the smalldatetime field in a database, but
I suspect there is a better way.
Any ideas?
Thanks
Marc Pelletier
I have a library of datetime routines that make things simpler for me.
Before I discovered DateTime.MinValue I had a function that looked like
public static DateTime DayZero { get { return new DateTime( 0,0,0); } }
I use it to compare for nonvalid datimes in some code, for example if
moonrise equals DayZero then the moon doesn't rise on that day.
Now I am SOOO much smarter and I refer to DateTime.MinValue instead. Is
there a simple way to get the equivalent result for a smalldatetime field?
Right now I am using
public static DateTime SmallDayZero {get {return new DateTime(1900,1,1);} }
to test if a value will fit into the smalldatetime field in a database, but
I suspect there is a better way.
Any ideas?
Thanks
Marc Pelletier