Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/DateTime2XmlFormatter.cs @ 1623

Last change on this file since 1623 was 1623, checked in by epitzer, 15 years ago

Namespace refactoring, visibility check (#548)

File size: 559 bytes
Line 
1using System;
2using HeuristicLab.Persistence.Core;
3using HeuristicLab.Persistence.Interfaces;
4using HeuristicLab.Persistence.Default.Decomposers.Storable;
5
6namespace HeuristicLab.Persistence.Default.Xml.Primitive {
7
8  [EmptyStorableClass]
9  public class DateTime2XmlFormatter : FormatterBase<DateTime, XmlString> {
10
11    public override XmlString Format(DateTime dt) {
12      return new XmlString(dt.Ticks.ToString());
13    }
14
15    public override DateTime Parse(XmlString x) {
16      return new DateTime(long.Parse(x.Data));
17    }
18
19  }
20
21
22}
Note: See TracBrowser for help on using the repository browser.