Public Class Tester
Public Shared Sub Main
Dim results As New System.Text.StringBuilder
Dim rightNow As Date = Now
results.AppendLine("RightNow: " & rightNow.ToString)
results.AppendLine()
results.AppendLine("One year ago: " & _
rightNow.AddYears(-1).ToString)
results.AppendLine("365.25 days ago: " & _
rightNow.AddDays(-365.25).ToString)
Console.WriteLine(results.ToString())
End Sub
End Class
RightNow: 11/05/2007 9:09:36 PM
One year ago: 11/05/2006 9:09:36 PM
365.25 days ago: 11/05/2006 3:09:36 PM