?
Solved

Showing time in date time picker

Posted on 2005-03-23
11
Medium Priority
?
269 Views
Last Modified: 2010-04-17
The selections for the ms date time picker dont seem to give an option to show a date like 03/23/05 12:00 PM. I am sure that I can format the thing so that I can show the time and make it possible for the user to edit the date and the time...does someone know how to set this property?
0
Comment
Question by:MikeORTEC
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
11 Comments
 
LVL 23

Expert Comment

by:gecko_au2003
ID: 13618038
Are you doing this in visual basic 6.0 ? If not what language ?
0
 

Author Comment

by:MikeORTEC
ID: 13618680
I am doing this in VB6...sorry
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:MikeORTEC
ID: 13618825
I used the PAQ to format the dtp in the following way:

DTPicker1.Format = dtpCustom
DTPicker1.CustomFormat = "mm/dd/yyyy hh:mm tt"

The date and time now load as I wanted them to, eg 03/23/2005 12:00 PM in the dtp.

But, changing the seconds in the time on the form, changes the month and vice versa...these seem to be somehow connected...if I scroll or change the seconds to 00, the month changes to 00 also....how do I format so that the changes are not tied to each other?
0
 
LVL 23

Expert Comment

by:gecko_au2003
ID: 13619611
let me try something out and I will get back to you :)
0
 
LVL 23

Expert Comment

by:gecko_au2003
ID: 13619771
Have you got 2 DT Pickers ? one for time and one for date ?
0
 

Author Comment

by:MikeORTEC
ID: 13621883
There are two DT pickers, but I need Date and time for each.  I guess that I could split them, but that would complicate the code.  I am sure that I have seen a DTP with both Date and Time included.  and I have managed to get both in there, but the erroneous linking of time with month needs to be solved.

Thansk.

Miike
0
 

Author Comment

by:MikeORTEC
ID: 13622343
What I would like to be able to do in the first one is get a date from the database in the following format

mm/dd/yyy hh:mm:ss tt

The second one should be set to "today" Noon

like

03/25/2005 12:00:00 PM

it always loads as AM and the minutes and month scroll together for some reason.

Thanks for the assistance!
0
 
LVL 23

Accepted Solution

by:
gecko_au2003 earned 1000 total points
ID: 13624387
Even though splitting would complicate the code it would probably get rid of the time / date clash. So try and do them in seperate ones and you could put 2 of them in a frame and put the other 2 in a frame :) Make it look neater and give them the option of first selecting the data and then the time and you could do some error checking to make sure that they have data in them before they can go to the next 2 :)
0
 

Author Comment

by:MikeORTEC
ID: 13624787
Dear Gecko,

Thanks, I appreciate you taking the time to look at this, but I figured it out.  the problem was that my custom format was mm/dd/yyy hh:mm:ss tt, but should have been capitalized for the month formatting, so it should have been like

MM/dd/yyy hh:mm:ss tt             'note the capitalized MM

This appears to allow me to have it all encapsulated in one control.  Last thing to do is find the property to set a dtp control date to todays date at run time....like the excel property =today() or =now() for individual cells.

I cannot seem to find this property of the control itself...i guess there would be a way to get it from windows and pass it to the control,but I dont know how...

Any help?
0
 
LVL 23

Expert Comment

by:gecko_au2003
ID: 13625039
When I had DTPicker1 it had Hour, minute, second and date or something like that so maybe you need to concatenate them ie

DTPicker1.Hour & ":" & DTPicker1.Minute & ":" & DTPicker1.Second

and then something like that for the date ?
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
Progress
Starting up a Project

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question