Table of Contents

Struct Timestamp

Namespace
NetCord
Assembly
NetCord.dll
public readonly struct Timestamp : IEquatable<Timestamp>, ISpanFormattable, IFormattable, ISpanParsable<Timestamp>, IParsable<Timestamp>
Implements
Inherited Members

Constructors

Timestamp(DateTimeOffset)

public Timestamp(DateTimeOffset dateTime)

Parameters

dateTime DateTimeOffset

Timestamp(DateTimeOffset, TimestampStyle?)

public Timestamp(DateTimeOffset dateTime, TimestampStyle? style)

Parameters

dateTime DateTimeOffset
style TimestampStyle?

Properties

DateTime

public DateTimeOffset DateTime { get; }

Property Value

DateTimeOffset

Style

public TimestampStyle? Style { get; }

Property Value

TimestampStyle?

Methods

Equals(Timestamp)

public bool Equals(Timestamp other)

Parameters

other Timestamp

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

Parse(ReadOnlySpan<char>)

public static Timestamp Parse(ReadOnlySpan<char> value)

Parameters

value ReadOnlySpan<char>

Returns

Timestamp

ToString()

public override string ToString()

Returns

string

Discord formatted timestamp with a default style.

ToString(TimestampStyle)

public string ToString(TimestampStyle style)

Parameters

style TimestampStyle

Returns

string

Discord formatted timestamp with specified style.

ToString(char)

public string ToString(char style)

Parameters

style char

Returns

string

Discord formatted timestamp with specified style.

ToString(string?, IFormatProvider?)

public string ToString(string? format, IFormatProvider? formatProvider)

Parameters

format string
formatProvider IFormatProvider

Returns

string

Discord formatted timestamp.

TryFormat(Span<char>, out int, ReadOnlySpan<char>, IFormatProvider?)

public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider? provider = null)

Parameters

destination Span<char>
charsWritten int
format ReadOnlySpan<char>
provider IFormatProvider

Returns

bool

TryParse(ReadOnlySpan<char>, out Timestamp)

public static bool TryParse(ReadOnlySpan<char> value, out Timestamp timestamp)

Parameters

value ReadOnlySpan<char>
timestamp Timestamp

Returns

bool

Operators

operator ==(Timestamp, Timestamp)

public static bool operator ==(Timestamp left, Timestamp right)

Parameters

left Timestamp
right Timestamp

Returns

bool

operator !=(Timestamp, Timestamp)

public static bool operator !=(Timestamp left, Timestamp right)

Parameters

left Timestamp
right Timestamp

Returns

bool

Explicit Interface Implementations

Parse(ReadOnlySpan<char>, IFormatProvider?)

static Timestamp Parse(ReadOnlySpan<char> s, IFormatProvider? provider)

Parameters

s ReadOnlySpan<char>
provider IFormatProvider

Returns

Timestamp

Parse(string, IFormatProvider?)

static Timestamp Parse(string s, IFormatProvider? provider)

Parameters

s string
provider IFormatProvider

Returns

Timestamp

TryParse(ReadOnlySpan<char>, IFormatProvider?, out Timestamp)

static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out Timestamp result)

Parameters

s ReadOnlySpan<char>
provider IFormatProvider
result Timestamp

Returns

bool

TryParse(string?, IFormatProvider?, out Timestamp)

static bool TryParse(string? s, IFormatProvider? provider, out Timestamp result)

Parameters

s string
provider IFormatProvider
result Timestamp

Returns

bool