C
Carl Prothman [MVP]
Ted said:I would like to format my date "06/08/2003 12:00" to something like "1 day
ago" or "24 hours ago". Is there a date format I can use to do this or does
anyone have any pointers as to how i could do this.
Ted,
You can subtract a day from a DateTime by using it's Subtract
method and a TimeSpan of 24 hours.
e.g.
Dim dt As DateTime = DateTime.Now()
dt = dt.Subtract(New TimeSpan(24, 0, 0))
Dim s As String = dt.ToShortDateString()
--
Thanks,
Carl Prothman
Microsoft ASP.NET MVP
http://www.able-consulting.com