DateTime Serialization to XML

I have an C# serializable object with a DateTime property like this:

        public class MyClass {
public DateTime Date1 {get;set;}
}

When serialized to XML, it gives me something like this


        <MyClass>
<Date1>2010-11-30T00:00:00</Date1>
</MyClass>

I could not get it to give me this, which is in the proper  xml date format:


        <MyClass>
<Date1>2010-11-30</Date1>
</MyClass>

After a couple of wasted days, it turned out that the solution is really simple:


        public class MyClass {
[System.Xml.Serialization.XmlElement("Date1", DataType="date")]
public DateTime Date1 {get;set;}
}

Does your employer own your side projects?

Apparently, according to Joel Spolsky, they do:

…So before you hire this guy, you agree, "hey listen, I know that inventing happens all the time, and it's impossible to prove whether you invented something while you were sitting in the chair I supplied in the cubicle I supplied or not. I don't just want to buy your 9-5 inventions. I want them all, and I'm going to pay you a nice salary to get them all," and he agrees to that, so now you want to sign something that says that all his inventions belong to the company as long as he is employed by the company.

This is where we are by default. This is the standard employment contract for programmers, inventors, and researchers.
[Read rest of the discussion at answers.onstartups.com…]

One Interesting corollary: if you spend your day-time working for an employer and night time working on a github open source project, and 2 years from now the OS project becomes wildly popular (wink), your open source project is probably not very “open” afterall, unless you’ve had the appropriate work-for-hire clauses stipulated in your employment agreement. I’m reminded of a vaguely similar case in recent history: the infamous SCO v. IBM debacle from a few years back.