tags:

views:

91

answers:

2

How do I get the system time using vb.net and copy it into clipboard automatically? Is there a built-in function in vb.net for this?

A: 

Use DateTime.Now to get the time and Google for the code to copy to the clipboard.

Or take a look at this post.

Gerrie Schenck
+1  A: 

I'm not sure what you mean by System Time but if it's just the string representation of the current time then you can do the following

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

This code will work in both WinForms and WPF

JaredPar
isn't it possible to just copy the time?
`ClipBoard.SetText(DateTime.Now.ToString("HH:mm:ss"))` Alter the format specifier to customize the appearance if you like http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx
MarkJ