Class HighPrecisionDateTimeFormatters
Helper class for FIX date and time formats.
Provides ability for formatting different types of date/time values to the buffer of bytes. It is also possible to work with high precision values: micro- and nanoseconds.
Inheritance
Inherited Members
Namespace: FixAntenna.Fix.Message
Assembly: FixAntenna.Message.dll
Syntax
public class HighPrecisionDateTimeFormatters
Methods
FormatStorageTimestamp(Byte[], Int32, DateTimeOffset, TimestampPrecision)
Formats the value of dateTime to Storage Timestamp format.
The format of Storage Timestamp is "YYYYMMDD HH:MM:SS.sss[sss][sss] - ".
Declaration
public static void FormatStorageTimestamp(byte[] buffer, int offset, DateTimeOffset dateTime, TimestampPrecision precision)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | buffer | the buffer of bytes to keep the Storage Timestamp format |
| System.Int32 | offset | the offset |
| System.DateTimeOffset | dateTime | the given date time value |
| TimestampPrecision | precision | the desired timestamp precision |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException |
formatTimeOnly(Byte[], DateTime, TimestampPrecision)
Formats the value of time to the UTCTimeOnly format.
The format for UTCTimeOnly is HH:MM:SS[.sss][sss][sss].
Declaration
public static void formatTimeOnly(byte[] buffer, DateTime time, TimestampPrecision precision)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | buffer | the buffer of bytes to keep the |
| System.DateTime | time | the given time value |
| TimestampPrecision | precision | the desired time precision |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException |
formatTimeOnly(Byte[], DateTime, TimestampPrecision, Int32)
Formats the value of time to the UTCTimeOnly format.
The format for UTCTimeOnly is HH:MM:SS[.sss][sss][sss].
Declaration
public static void formatTimeOnly(byte[] buffer, DateTime time, TimestampPrecision precision, int offset)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | buffer | the buffer of bytes to keep the |
| System.DateTime | time | the given time value |
| TimestampPrecision | precision | the desired time precision |
| System.Int32 | offset | the offset |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException |
FormatTimestamp(Byte[], DateTime, TimestampPrecision)
Formats the value of dateTime to Timestamp format.
The format of Timestamp is YYYYMMDD-HH:MM:SS[.sss][sss][sss].
Declaration
public static void FormatTimestamp(byte[] buffer, DateTime dateTime, TimestampPrecision precision)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | buffer | the buffer of bytes to keep the |
| System.DateTime | dateTime | the given date time value |
| TimestampPrecision | precision | the desired timestamp precision |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException |
FormatTimestamp(Byte[], DateTime, TimestampPrecision, Int32)
Formats the value of dateTime to Timestamp format.
The format of Timestamp is YYYYMMDD-HH:MM:SS[.sss][sss][sss].
Declaration
public static void FormatTimestamp(byte[] buffer, DateTime dateTime, TimestampPrecision precision, int offset)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | buffer | the buffer of bytes to keep the |
| System.DateTime | dateTime | the given date time value |
| TimestampPrecision | precision | the desired timestamp precision |
| System.Int32 | offset | the offset |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException |
formatTZTimeOnly(Byte[], DateTimeOffset, TimestampPrecision)
Formats the value of time to the TZTimeOnly format.
The format for TZTimeOnly is HH:MM[:SS][.sss][sss][sss][Z | [ + | - hh[:mm]]].
Declaration
public static void formatTZTimeOnly(byte[] buffer, DateTimeOffset time, TimestampPrecision precision)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | buffer | the buffer of bytes to keep the |
| System.DateTimeOffset | time | the given time value |
| TimestampPrecision | precision | the desired time precision |
formatTZTimeOnly(Byte[], DateTimeOffset, TimestampPrecision, Int32)
Formats the value of time to the TZTimeOnly format.
The format for TZTimeOnly is HH:MM[:SS][.sss][sss][sss][Z | [ + | - hh[:mm]]].
Declaration
public static void formatTZTimeOnly(byte[] buffer, DateTimeOffset time, TimestampPrecision precision, int offset)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | buffer | the buffer of bytes to keep the |
| System.DateTimeOffset | time | the given time value |
| TimestampPrecision | precision | the desired time precision |
| System.Int32 | offset | the offset |
FormatTzTimestamp(Byte[], DateTimeOffset, TimestampPrecision)
Formats the value of dateTime to the TZTimestamp} format.
The format for TZTimestamp is YYYYMMDD-HH:MM[:SS][.sss][sss][sss][Z | [ + | - hh[:mm]]].
Declaration
public static void FormatTzTimestamp(byte[] buffer, DateTimeOffset dateTime, TimestampPrecision precision)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | buffer | the buffer of bytes to keep the |
| System.DateTimeOffset | dateTime | the given date time value |
| TimestampPrecision | precision | the desired timestamp precision |
FormatTzTimestamp(Byte[], DateTimeOffset, TimestampPrecision, Int32)
Formats the value of dateTime to the TZTimestamp format.
The format for TZTimestamp is YYYYMMDD-HH:MM[:SS][.sss][sss][sss][Z | [ + | - hh[:mm]]].
Declaration
public static void FormatTzTimestamp(byte[] buffer, DateTimeOffset dateTime, TimestampPrecision precision, int offset)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | buffer | the buffer of bytes to keep the |
| System.DateTimeOffset | dateTime | the given date time value |
| TimestampPrecision | precision | the desired timestamp precision |
| System.Int32 | offset | the offset |