Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
DateOfBirth.cs
1using System;
2using System.Globalization;
3
5{
9 public class DateOfBirth : StringObject
10 {
14 public DateOfBirth()
15 : base()
16 {
17 }
18
25 public DateOfBirth(byte[] Value, string StringValue, DateTime Timestamp)
26 : base(Value, StringValue)
27 {
28 this.Timestamp = Timestamp;
29 }
30
34 public override ushort Tag => 0x5f2b;
35
39 public DateTime Timestamp { get; }
40
47 public override StringObject Create(byte[] Value, string StringValue)
48 {
49 int Year = int.Parse(StringValue.Substring(0, 4), CultureInfo.InvariantCulture);
50 int Month = int.Parse(StringValue.Substring(4, 2), CultureInfo.InvariantCulture);
51 int Day = int.Parse(StringValue.Substring(6, 2), CultureInfo.InvariantCulture);
52
53 return new DateOfBirth(Value, StringValue, new DateTime(Year, Month, Day));
54 }
55 }
56}
DateOfBirth(byte[] Value, string StringValue, DateTime Timestamp)
Date of Birth
Definition: DateOfBirth.cs:25
override StringObject Create(byte[] Value, string StringValue)
Creates an instance of the string-valued data object.
Definition: DateOfBirth.cs:47
Abstract base class for string-valued objects.
Definition: StringObject.cs:10