VB.NET How to make a custom system time (real-time)

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.

Answers


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)


Need Your Help

programmatic authentication for JMX in Websphere

spring authentication login websphere jmx

We would like to make JMX calls to other deployed applications within Websphere Application Server. This works fine if you do this within a web application where a user does a login with the right

How do I hide panels when there is no default extender id

asp.net ajaxcontroltoolkit

I am using the .NET AjaxControlToolkit (don't ask why, I inherited this project). I create panels and then using a button, pup up the panel as follows:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.