So Im stuck here on my project in VB.Net . I wanted to make a user defined date time function that is not dependent on the system time Ive tried to search on the net but they only gave me how to print current system time. Any idea guys how to make a customized date time updating every seconds in other words real time .
any answers will be entertained thanks in advance.
You can save the value of Date.Now
at the start of your application in a global variable:
Public StartDate As Date = Date.Now
Then you can calculate the current date in your arbitrary time scale, using the TimeSpan
calculated from this starting date and the current date, at any point in your code:
Dim Elapsed As TimeSpan = Date.Now - StartDate
Dim NewDate As Date = ArbitraryStartDate + Elapsed
Choose ArbitraryStartDate
to be any date you like with the Date
constructor like
Dim ArbitraryStartDate As Date = New Date(1983, 05, 03)