Link to home
Start Free TrialLog in
Avatar of isnoend2001
isnoend2001Flag for United States of America

asked on

Problem the time from datepicker in vb6

never used the date picker before
i am trying to get the time to use in a filename using the date picker
the code:
Private Sub Command_Click()
Dim fName As String
Dim mytime As Date
mytime = Hour(DTPicker1.Value)
fName = "Dy" & mytime
MsgBox fName
End Sub

Open in new window

User generated imageUser generated image
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Please upload your project and tell me what to do to reproduce the problem.
Avatar of isnoend2001


Thanks Marty
i Decided to test using the datepicker , with a test project
 all i have is a form, datepicker and command button with the code above
As soon  i change the time it no longer  displays correctly
uploaded the test project
Your upload doesn't seem to have worked. Marty, and anyone else, can't help you unless we know what you are doing to produce the display message.
Where do you change the time?
Please explain what you are trying to do here.

mytime = Hour(DTPicker1.Value)
fName = "Dy" & mytime
See me question above but if all you want is to produce "Dy 23" for example if the time is 11PM then change mytime from a Date to and Integer.
What i am trying to do is produce a filename to match the time selected eg:
11:45 = Da 1145
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks Marty that works
Glad I could help.
Have more questions on using the date picker. i will post questions