borderAndreaVB free resources for Visual Basic developersborder
borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2014 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (mouse wheel detection by background window)Next Topic (Hide program in Ctrl+Alt+Del list?) New Topic New Poll Post Reply
AndreaVB Forum : API : Converting String into Date/Time Solved Topic
Poster Message
x_router
Level: Graduate

Registered: 07-05-2006
Posts: 9

icon Converting String into Date/Time

Hi! here i' am again. I just want to ask for ur help.

Im having difficulties converting string data into time

Ex: string data : "0920"
Expected result in time: 9:20

I tried using cdate function, but it doest work well.
by the way im using VB6.

Please help me with this, i really need to finish my project ASAP. Guys, you are my only hope.

Thanks A lot

19-09-2006 at 10:46 AM
View Profile Send Email to User Show All Posts | Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 1037
icon Re: Converting String into Date/Time

Hi,
For the example you've given, try the following:

dim dt as date
dim s as string
s="920"
dt = cdate(format(s,"00:00"))


Hope this helps,
Kieron


____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

22-09-2006 at 09:51 AM
View Profile Send Email to User Show All Posts | Quote Reply
x_router
Level: Graduate

Registered: 07-05-2006
Posts: 9
icon Re: Converting String into Date/Time

thanks for always enlighten me.  

23-09-2006 at 08:00 AM
View Profile Send Email to User Show All Posts | Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 1037
icon Re: Converting String into Date/Time

Hi x_router,
Can you mark this as Solved if you are happy.
thanks
Kieron


____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

23-09-2006 at 09:45 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : API : Converting String into Date/Time Solved Topic
Previous Topic (mouse wheel detection by background window)Next Topic (Hide program in Ctrl+Alt+Del list?) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
borderAndreaVB free resources for Visual Basic developersborder
borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2014 Andrea Tincaniborder