<p>Please consider this example class:</p>

<pre><code>[Serializable]
public class SomeClass
{
    private DateTime _SomeDateTime;

    public DateTime SomeDateTime
    {
        get { return _SomeDateTime; }
        set { _SomeDateTime = value; }
    }
}
</code></pre>

<p>I would like to alter the serialization of any DateTime declared in the class according to my own rules. The members of this class will change frequently and I don't want to maintain a custom serializer for every change. Also I would like this behaviour to be inherited by subclasses and not code a custom serializer for every one. The serialization is being output by a web service. Thanks for any help!</p>

Have you thought about simply using a Nullable date time
```
```
public DateTime? SomeDateTime {get; set;}
```
```
This way you can actually have a null value as a legitimate value in your class. Typically you want to avoid custom serialization whenever possible. Once you do custom serialization such as implementing
ISerializable
, then you are stuck with it, and all other derived classes are stuck with it.
Remember what a pain in the butt it is to have to always override the ISerializable members for custom exceptions? This is because System.Exception implements ISerializable and therefore all derived exceptions (that means everything) must implement those members if you ever expect them to cross AppDomains.