Bruno Jouhier [MVP] <bj******@club-internet.fr> wrote:
I'm afraid that you don't have control over this and that you have to do
some string manipulations if you want to control it.
Actually, I've just come up with a slightly nicer way of doing it - you
only need to do the string manipulations once.
Basically, you clone an existing DateTimeFormatInfo and alter the
DayNames and AbbreviatedDayNames properties, and then pass that
DateTimeFormatInfo in when formatting the DateTime:
using System;
using System.Globalization;
class Test
{
static void Main()
{
DateTimeFormatInfo dtfi =
CultureInfo.CurrentCulture.DateTimeFormat;
dtfi = (DateTimeFormatInfo) dtfi.Clone();
dtfi.DayNames = LowerNames(dtfi.DayNames);
dtfi.AbbreviatedDayNames = LowerNames
(dtfi.AbbreviatedDayNames);
Console.WriteLine (DateTime.Now.ToString("ddd. dd", dtfi));
}
static string[] LowerNames (string[] old)
{
string[] ret = new string[old.Length];
for (int i=0; i < ret.Length; i++)
{
ret[i] = Char.ToLower(old[i][0])+old[i].Substring(1);
}
return ret;
}
}
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too