We have a problem with the built-in .net date formatting. We are using the abbreviated month format:
string.Format("{0:MMM}", date);
For our Czech site, it outputs Roman numerals (eg “IV” where in en-GB it would be “Apr”). We want to change this to some custom abbreviations.
What is the best way to do this? I don’t really want to put an if statement in the view. Should I use a DateTimeFormatInfo?
Also, how do Microsoft decide on the formatting, is it based on a standard?
Which culture do you want to use? You can just specify it in the call to
string.Format. For example:Note that if that’s really all you’re formatting, it would be simpler to call
ToString:(That way you don’t need all the composite formatting stuff.)