Click here to Skip to main content
15,914,500 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In My application it is required to fill up all supported DateTime Formats in Combobox programmatically,I dont know how to do it.I am using Windows 7.0
and I am developing MDI application in VC++,MFC.Please help
Posted
Comments
Sergey Alexandrovich Kryukov 4-Jan-13 3:55am    
What does it mean, "all supported"?
—SA
adityarao31 4-Jan-13 7:08am    
All the supported date time by windows

1 solution

Probably you don't understand: number of different time formats is infinite, because you can create any custom format. Please see the links at the end.

Only default formats, perhaps? This is not how it works. Basically, there is only one fully default time format. Per culture. If you want to list all formats, you just need to list all cultures, which is easy. If you need to change time format not using any custom format, you just change the current thread culture, and all code will output (and expect on parse) the format of different culture.

But even that does not define "all formats", by one interesting reason: you can also create your own "custom culture". Useful feature. Who knows, what if someone wants to organize a new state with distinct culture. What to do then? :-)

Now, I just explain you the concept (and, very likely, your misconception; however I can imagine it was just unclear working). Sorry, I did not explain how to do it, what I described above. By two reasons:

1) You can easily find it all, as now you know the key words, and you would not need anything but MSDN; 2) I don't think this is what you needed.

So for now, only two links:
http://msdn.microsoft.com/en-us/library/az4se3k1.aspx[^],
http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx[^].

On your request, I'll gladly explain everything else.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900