[Mono-list] Patch for DataTime.cs

Elan Feingold efeingold@mn.rr.com
Thu, 27 Feb 2003 12:09:06 -0600


> Interestingly, I am also doing something related to DateTime, but in
> System.Xml.XmlConverter. It seems that in Mono, "zzzzzz" does not
work. And I
> cannot find its definition in MS's doc too.

OK, we may have overlapped there. I changed XmlConvert.ToDateTime() to:

		public static DateTime ToDateTime(string s)
		{
            string format = "yyyy-MM-ddTHH:mm:sszzzzzz";
            return DateTime.ParseExact(s, format, null);
		}

and

		public static string ToString(DateTime value)
		{
			return (value.ToString("s",
CultureInfo.InvariantCulture) + 
                    value.ToString ("zzz"));
}

This makes it match the MS impl., and lets the XML [de]serialization I'm
working on work perfectly.

> The three characters are Byte Order Mark (BOM) of UTF-8 encoding. It
should
> have been surpressed by your terminal, if it is implemented correctly.

Cool, I just changed PuTTY and now it works perfectly. Thanks!!!!

-elan