BeanSoftware Logo
 

 
ASP.NET Database Search Control
 
 

 
 Home
    Shop
    Advertise
    Write For Us
    Affiliate
    Newsletter
    Contact

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

FAQ toolbar: Submit FAQ  |  Tell A Friend  |  Add to favorites  |  Feedback



Copyright © 2002-2008 Bean Software. All rights reserved.