How To Show Only Time From DateTime Variable?
To show only time part from DateTime you can use its ToString() method. Code could look like this:
[ C# ]
string OnlyTime = DateTime.Now.ToString("hh:mm:ss");
[ VB.NET ]
Dim OnlyTime As String = DateTime.Now.ToString("hh:mm:ss")
Related articles:
1. Implementing Code Behind in ASP.NET
Copyright © 2002-2008 Bean Software. All rights reserved.