Changeset 1564 for trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/DateTime2XmlFormatter.cs
- Timestamp:
- 04/16/09 12:40:41 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/DateTime2XmlFormatter.cs
r1454 r1564 6 6 7 7 [EmptyStorableClass] 8 public class DateTime2XmlFormatter : IFormatter { 9 10 public Type Type { get { return typeof(DateTime); } } 11 public IFormat Format { get { return XmlFormat.Instance; } } 12 13 public object DoFormat(object o) { 14 return ((DateTime)o).Ticks.ToString(); 8 public class DateTime2XmlFormatter : FormatterBase<DateTime, XmlString> { 9 10 public override XmlString Format(DateTime dt) { 11 return new XmlString(dt.Ticks.ToString()); 15 12 } 16 13 17 public o bject Parse(object o) {18 return new DateTime(long.Parse( (string)o));14 public override DateTime Parse(XmlString x) { 15 return new DateTime(long.Parse(x.Data)); 19 16 } 20 17
Note: See TracChangeset
for help on using the changeset viewer.