Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use DateTimePicker without AMPM 1

Status
Not open for further replies.

JTBorton

Technical User
Jun 9, 2008
345
0
0
DE
I'm trying to use a control to enter running times. I'd rather not use 3 separate textboxes for the hours, seconds and minutes. The datetimepicker has a time entry capability, but it forces AMPM. If I try to enter a custom time format it changes the datetimepicker style back to a date picker with dropdown calendar. Does anyone know how to use the time style of the datetimepicker without the AMPM? I resorted to shrinking the size of the control so that the AMPM is hidden, but I'd like to get rid of it altogether.

-Joshua
Well, You can try banging your head against the wall, but you just end up with lost-time injuries and damaged equipment. [M. Passman]
 
I do not think this is possible. AFAIK, DTPicker when its Format = dtpTime, this means there is AM/PM. I do not know of a way to force a 24 hour format, which I take it is what you want.


unknown
 


a control to enter running times.
Although it seems like a good approch, there is really a difference in a Time VALUE and a Duration VALUE. You do not notice the difference until you have durations that exceed 24 hours.

Bottom line: you are entering duration in hours, minutes and seconds, not a time value. A distinction that can be with or without a difference.

I'd opt for entering 3 separate values.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Datetimepicker uses time format set in system settings. Even when set to dtpTime it stores date+time, check it's value - it returns today's date + time set.
Date/time formatting is case sensitive, for instance 'h' indicates 12h clock, 'H' 24h clock. Similarly, m/M are for minutes/months. To block calendar in custom format tick the 'UpDown' checkbox on the propertypages.

combo
 
Combo, the updown property nailed it. Thanks!

-Joshua
Well, You can try banging your head against the wall, but you just end up with lost-time injuries and damaged equipment. [M. Passman]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top