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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DateTimePicker format

Status
Not open for further replies.

Rached

Programmer
Mar 30, 2003
54
DK
Hello all, here hasn't been any where i haven't looked to solve this thing, but useless, some one might know here.

I have a datetimepicker of dtkTime type. By default it displays 12:00:00 AM. On run time i load different time values into it. The question is how to make the format look like hh:mm ? example 2:00:00 PM to 14:00 ? pulling the value to a text edit with
AnsiString test = FormatDateTime("hh:mm", StartTimePicker2->DateTime);
works fine but useless i can't put that string in the datetimepicker. how to set the format by default to hh:mm any one for help ? tnx
 
Hi

The format of the date and time picker is actually governed elsewhere...

Start menu -> Control Panel -> regional Settings

Look at the time page...

The format that you specify time to be displayed in on that screen is the same format that the date and time picker will use for its display. Change the default and the date and time picker will update without any code / property changes .


Then I could be talking crap but it worked on my machine..

Regards

BuilderSpec
 
It worked exactly as you described, thanks. If i want my program to display "HH:mm" in any machine it runs on, i dont want to make the user change it manually, think it could be done throught editing the registry on run time to set the proper format, then back to default value once done ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top