.NET Framework DateTime wish

  • Thread starter Thread starter Daniel
  • Start date Start date
D

Daniel

Hi All, MS guys specially...

is the a way to make DateTime structure smarter than is now?
i mean if i want a DateTime field with Date, just a Date, i cant have it coz
it appends internally the time too...that's stupid...

if i want to show a datetime i must call its .ToString() with some
formatting options...

can DateTime.Today be made to show *ONLY* date and no time?

thanks,
Dan
 
Well Daniel,

DateTime.Today.ToShortDateString();

It is the same as calling

DateTime.Today.ToString("d", null);
 
I wrote a DateTime truncation routine to zero-out the portions of the date
that aren't needed. (kinda like Oracle's trunc() function).

Ex: DateTruncate ( somedatetimevalue , "DD" )
will subtract the hours, minutes, seconds, and milliseconds from
somedatetimevalue by using code like...

case "SS" :
{
Subject = Subject.AddMilliseconds ( Subject.Millisecond *
-1 ) ;
break ;
}
 
Hi Daniel.

DateTime dt = DateTime.Now;

Console.WriteLine(dt.ToShortDateString());

this dispaly one the date

M
 
Back
Top