Struct Timestamp
Represents a timestamp.
Представляет метку времени.
Implements
Inherited Members
Namespace: Platform.Timestamps
Assembly: Platform.Timestamps.dll
Syntax
public struct Timestamp : IEquatable<Timestamp>
Remarks
To make this timestamp truly unique, it is recommended to use UniqueTimestampFactory.
Чтобы эта метка времени была действительно уникальна рекомендуется использовать UniqueTimestampFactory.
Constructors
| Improve this Doc View SourceTimestamp(UInt64)
Creates a timestamp.
Создаёт метку времени.
Declaration
public Timestamp(ulong ticks)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt64 | ticks | A number representing the number of ticks. Число представляющие количество тиков. |
Fields
| Improve this Doc View SourceDefaultFormat
Returns a string containing the default DateTime format for Timestamp.
Возвращает строку, содержащую формат даты и времени по умолчанию для метки времени.
Declaration
public static readonly string DefaultFormat
Field Value
| Type | Description |
|---|---|
| String |
Ticks
Gets or sets the number of ticks that represent the date and time in UTC.
Возвращает или устанавливает количество тиков, которые представляют дату и время в UTC.
Declaration
public readonly ulong Ticks
Field Value
| Type | Description |
|---|---|
| UInt64 |
Methods
| Improve this Doc View SourceEquals(Timestamp)
Определяет, равна ли текущая отметка времени другой отметке времени.
Indicates whether the current Timestamp is equal to another Timestamp.
Declaration
public bool Equals(Timestamp other)
Parameters
| Type | Name | Description |
|---|---|---|
| Timestamp | other | Other Timestamp. Другая отметка времени. |
Returns
| Type | Description |
|---|---|
| Boolean | True if the current Timestamp is equal to the other Timestamp; otherwise, false. Истину, если текущая отметка времени равна другой отметке времени; иначе ложь. |
Equals(Object)
Determines whether the specified object is equal to the current object.
Определяет, равен ли указанный объект текущему объекту.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | obj | The object to compare with the current object. Объект для сравнения с текущим объектом. |
Returns
| Type | Description |
|---|---|
| Boolean | True if the specified object is equal to the current object; otherwise, false. Истину, если указанный объект равен текущему объекту; иначе ложь. |
Overrides
| Improve this Doc View SourceGetHashCode()
Serves as the default hash function.
Служит в качестве хэш-функции по умолчанию.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| Int32 | A hash code for the current object. Хеш-код для текущего объекта. |
Overrides
| Improve this Doc View SourceToString()
Returns a string that represents the current Timestamp.
Возвращает строку, которая представляет текущую метку времени.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| String | A string that represents the current Timestamp. Строка, представляющая текущую метку времени. |
Overrides
Operators
| Improve this Doc View SourceEquality(Timestamp, Timestamp)
Determines if the specified timestamp is equal to the current timestamp.
Определяет, равна ли указанная метка времени текущей метке времени.
Declaration
public static bool operator ==(Timestamp left, Timestamp right)
Parameters
| Type | Name | Description |
|---|---|---|
| Timestamp | left | The current timestamp. Текущая метка времени. |
| Timestamp | right | A timestamp to compare with this timestamp. Метка времени для сравнения с этой меткой времени. |
Returns
| Type | Description |
|---|---|
| Boolean | True if the current timestamp is equal to the other timestamp; otherwise, false. True, если текущий метка времени равна другой метке времени; иначе false. |
Implicit(Timestamp to DateTime)
Defines an implicit conversion of a Timestamp to a DateTime.
Определяет неявное преобразование метки времени в DateTime.
Declaration
public static implicit operator DateTime(Timestamp timestamp)
Parameters
| Type | Name | Description |
|---|---|---|
| Timestamp | timestamp | The Timestamp. Отметка времени. |
Returns
| Type | Description |
|---|---|
| DateTime |
Implicit(Timestamp to UInt64)
Defines an implicit conversion of a Timestamp to a 64-bit unsigned integer.
Определяет неявное преобразование метки времени в 64-разрядное целое число без знака.
Declaration
public static implicit operator ulong (Timestamp timestamp)
Parameters
| Type | Name | Description |
|---|---|---|
| Timestamp | timestamp | The Timestamp. Отметка времени. |
Returns
| Type | Description |
|---|---|
| UInt64 |
Implicit(DateTime to Timestamp)
Defines an implicit conversion of a DateTime to a Timestamp.
Определяет неявное преобразование DateTime в метку времени.
Declaration
public static implicit operator Timestamp(DateTime dateTime)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTime | dateTime | The DateTime struct. Структура DateTime. |
Returns
| Type | Description |
|---|---|
| Timestamp |
Implicit(UInt64 to Timestamp)
Defines an implicit conversion of a 64-bit unsigned integer to a Timestamp.
Определяет неявное преобразование 64-разрядного целого числа без знака в метку времени.
Declaration
public static implicit operator Timestamp(ulong ticks)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt64 | ticks | The number of ticks represented as a 64-bit integer. Количество тиков представленное в виде 64-разрядного целого числа. |
Returns
| Type | Description |
|---|---|
| Timestamp |
Inequality(Timestamp, Timestamp)
Determines if the specified timestamp is not equal to the current timestamp.
Определяет, не равна ли указанная метка времени текущей метке времени.
Declaration
public static bool operator !=(Timestamp left, Timestamp right)
Parameters
| Type | Name | Description |
|---|---|---|
| Timestamp | left | The current timestamp. Текущая метка времени. |
| Timestamp | right | A timestamp to compare with this timestamp. Метка времени для сравнения с этой меткой времени. |
Returns
| Type | Description |
|---|---|
| Boolean | True if the current timestamp is not equal to the other timestamp; otherwise, false. True, если текущий метка времени не равна другой метке времени; иначе false. |