Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Small method to calculate since time
Message
From
04/10/2011 09:20:22
John Baird
Coatesville, Pennsylvania, United States
 
 
To
04/10/2011 08:47:41
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01525501
Message ID:
01525541
Views:
45
>Also, if you try that version, you will see it will give 5, 3 and 1:
>
>
>        Dim earlierDate As New DateTime(2007, 8, 5, 10, 15, 0)
>        Dim timespan As TimeSpan = DateTime.Now.Subtract(earlierDate)
>        Dim difference As New DateTime(timespan.Ticks)
>        MessageBox.Show(difference.Year.ToString + " " + difference.Month.ToString + " " + difference.Day.ToString)
>
>
>We still have only one month completed since August 5th and it gives 3. So, I am not sure this approach will work as well.


Yes but your start time in this example is 2007 ... 3 years ago...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform