Link to home
Start Free TrialLog in
Avatar of VBdotnet2005
VBdotnet2005Flag for United States of America

asked on

convert date time

How can I convert datetime from

6/30/2012  12:25:00 AM

to

12:25:00.0000000
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Are you starting from a String or a DateTime?
ASKER CERTIFIED SOLUTION
Avatar of chwong67
chwong67
Flag of Malaysia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Assuming you have a DateTime (possibly converted from a String first, see your other questions), you just call ToString() and pass in your format:
        Dim dt As DateTime = DateTime.Now
        Label1.Text = dt.ToString("h:mm:ss.fffffff")

Open in new window


See here for more details:
http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx
Avatar of VBdotnet2005

ASKER

thank you