D
Dylan Parry
Hi folks,
I was wondering if there is any way of formatting a date to include the
ordinal characters? I've looked at the documentation for
DateTime.ToString(), but no where can I find information on ordinals.
For example, I currently use:
Console.WriteLine(myDate.ToString("d MMMM, yyyy"));
Which results in:
15 June, 2006
But I would like to have:
15th June, 2006
Am I overlooking anything? The only way I can think to do it is to use a
switch statement that takes the myDate.ToString("d") value as a
parameter and then returns the ordinal.
Any other ideas?
Thanks,
I was wondering if there is any way of formatting a date to include the
ordinal characters? I've looked at the documentation for
DateTime.ToString(), but no where can I find information on ordinals.
For example, I currently use:
Console.WriteLine(myDate.ToString("d MMMM, yyyy"));
Which results in:
15 June, 2006
But I would like to have:
15th June, 2006
Am I overlooking anything? The only way I can think to do it is to use a
switch statement that takes the myDate.ToString("d") value as a
parameter and then returns the ordinal.
Any other ideas?
Thanks,