2

I need to deserialize an XML file into a class. I'd like to find the best way to handle DateTime values coming in as YYYY/MM/DD hh:mm:ss, but the standard expected is YYYY-MM-DD hh:mm:ss.

Ideas are make the class property string then deal with it (per case, add properties that access and convert, add DateTime extension methods) or use custom serialization.

Is there a better way I'm missing? It feels like there could be some sort of configuration on the serializing without writing custom, for example. Just trying to not reinvent the wheel.

Rui Jarimba
  • 11,166
  • 11
  • 56
  • 86
John Spiegel
  • 1,861
  • 3
  • 24
  • 39

0 Answers0