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

time problemtime problem
isnoend2001Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Martin LissOlder than dirtCommented:
Please upload your project and tell me what to do to reproduce the problem.
0
isnoend2001Author Commented:
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
0
isnoend2001Author Commented:
uploaded the test project
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

GrahamSkanRetiredCommented:
isnoend2001,
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.
0
isnoend2001Author Commented:
uploaded again__Time.zip
0
Martin LissOlder than dirtCommented:
Where do you change the time?
0
Martin LissOlder than dirtCommented:
Please explain what you are trying to do here.

mytime = Hour(DTPicker1.Value)
fName = "Dy" & mytime
0
Martin LissOlder than dirtCommented:
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.
0
isnoend2001Author Commented:
What i am trying to do is produce a filename to match the time selected eg:
11:45 = Da 1145
0
Martin LissOlder than dirtCommented:
Private Sub Command_Click()
Dim fName As String
fName = "Dy " & Format(DTPicker1.Value, "HHMM")
End Sub

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
isnoend2001Author Commented:
Thanks Marty that works
0
Martin LissOlder than dirtCommented:
Glad I could help.
0
isnoend2001Author Commented:
Have more questions on using the date picker. i will post questions
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.