I have an MFC dialog with a time control. Currently, if I change the ‘Long time’ format on my PC (for example in Win7 -> Region and Language -> Long time), the dialog will follow suit and display in the selected format. However, I do not need the seconds to be displayed. Is there a way that I can pull the ‘Short time’ picture instead?
I know that I can remove the seconds by using .SetFormat on the control, but this hard codes whatever format I enter and does not allow the user to switch between standard and military times (which is required).
Use GetLocaleInfoEx to get the format string for the short date (ie LOCALE_SSHORTDATE) for your user’s locale setting and pass that to SetFormat method.