I know that I could use a format string, but I don’t want to lose the culture specific representation of the date/time format. E.g.
5/4/2011 | 2:06 PM | ... should be 05/04/2011 | 02:06 PM | ...
But when I change it to a different culture, I want it to be
04.05.2011 | 14:06 | ...
without changing the format string. Is that possible?
I see only a single solution – you should obtain the current culture display format, patch it so that it meets your requirement and finally format your DateTime value using the patched format string. Here is some sample code:
As promised, here is the improved version: