VBdotnet2005
asked on
convert date time
How can I convert datetime from
6/30/2012 12:25:00 AM
to
12:25:00.0000000
6/30/2012 12:25:00 AM
to
12:25:00.0000000
Are you starting from a String or a DateTime?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Assuming you have a DateTime (possibly converted from a String first, see your other questions), you just call ToString() and pass in your format:
See here for more details:
http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx
Dim dt As DateTime = DateTime.Now
Label1.Text = dt.ToString("h:mm:ss.fffffff")
See here for more details:
http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx
ASKER
thank you