I am trying to get a CDateTimeCtrl control in a dlg box to show 24 hour time format rather than am/pm nonsense.
I would have thought there was a flag for this, but MS decided NOT to provide one.
Is it possible?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Even though
CDateTimeCtrldoesn’t provide a class method to change the format, the class itself wraps the Win32 date and time picker which does allow you to set a custom format. You can do this by sending a message directly to the control:Edit: As @Kirill V. Lyadvinsky points out, you can simply use the
CDateTimeCtrl::SetFormatmethod — I somehow missed that when I was looking at the reference.