Get system time in VB.NET

How to get the system time using VB.NET and automatically copy it to the clipboard?

Is there a built-in function in VB.NET for this?

+3
source share
3 answers

I'm not sure what you mean by system time, but if it's just a string representation of the current time, you can do the following.

ClipBoard.SetText(DateTime.Now.ToString())

This code will work in both Windows Forms and WPF.

+5
source

Use DateTime.Now to get time and google to copy code to clipboard.

Or check out this post.

0
source

DateTime.UtcNow. DST.

UTC . , /.

0
source

Source: https://habr.com/ru/post/1733485/


All Articles