By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,573 Members | 1,924 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,573 IT Pros & Developers. It's quick & easy.

how to get just the current time in vb.net?

P: n/a
dk
what format is required to get just the
current time, for example
11:34 AM within vb.net?

tia,
dk
Nov 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
In article <06****************************@phx.gbl>, dk wrote:
what format is required to get just the
current time, for example
11:34 AM within vb.net?

tia,
dk


If you mean display?

DateTime.Now.ToLongTimeString()
DateTime.Now.ToShortTimeString()

HTH
--
Tom Shelton
MVP [Visual Basic]
Nov 20 '05 #2

P: n/a
Hi,
Me.Text = Now.ToShortTimeString

Ken

--------------------

"dk" <dm*****@mindspring.com> wrote in message
news:06****************************@phx.gbl...
what format is required to get just the
current time, for example
11:34 AM within vb.net?

tia,
dk

Nov 20 '05 #3

P: n/a
try this one...

Console.WriteLine(Date.UtcNow)
Nov 20 '05 #4

P: n/a
* "dk" <dm*****@mindspring.com> scripsit:
what format is required to get just the
current time, for example
11:34 AM within vb.net?


Try 'DateTime.Now'.

--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.