Avatar of VBdotnet2005
VBdotnet2005
Flag 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
Visual Basic.NET.NET Programming

Avatar of undefined
Last Comment
VBdotnet2005

8/22/2022 - Mon
Mike Tomlinson

Are you starting from a String or a DateTime?
ASKER CERTIFIED SOLUTION
chwong67

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Mike Tomlinson

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
VBdotnet2005

ASKER
thank you
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck