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
DateTimeOffsetstyle
TimestampStyle?
Properties
DateTime
public DateTimeOffset DateTime { get; }
Property Value
Style
public TimestampStyle? Style { get; }
Property Value
Methods
Equals(Timestamp)
public bool Equals(Timestamp other)
Parameters
other
Timestamp
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
obj
object
Returns
GetHashCode()
public override int GetHashCode()
Returns
Parse(ReadOnlySpan<char>)
public static Timestamp Parse(ReadOnlySpan<char> value)
Parameters
value
ReadOnlySpan<char>
Returns
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
stringformatProvider
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
intformat
ReadOnlySpan<char>provider
IFormatProvider
Returns
TryParse(ReadOnlySpan<char>, out Timestamp)
public static bool TryParse(ReadOnlySpan<char> value, out Timestamp timestamp)
Parameters
value
ReadOnlySpan<char>timestamp
Timestamp
Returns
Operators
operator ==(Timestamp, Timestamp)
public static bool operator ==(Timestamp left, Timestamp right)
Parameters
Returns
operator !=(Timestamp, Timestamp)
public static bool operator !=(Timestamp left, Timestamp right)
Parameters
Returns
Explicit Interface Implementations
Parse(ReadOnlySpan<char>, IFormatProvider?)
static Timestamp Parse(ReadOnlySpan<char> s, IFormatProvider? provider)
Parameters
s
ReadOnlySpan<char>provider
IFormatProvider
Returns
Parse(string, IFormatProvider?)
static Timestamp Parse(string s, IFormatProvider? provider)
Parameters
s
stringprovider
IFormatProvider
Returns
TryParse(ReadOnlySpan<char>, IFormatProvider?, out Timestamp)
static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out Timestamp result)
Parameters
s
ReadOnlySpan<char>provider
IFormatProviderresult
Timestamp
Returns
TryParse(string?, IFormatProvider?, out Timestamp)
static bool TryParse(string? s, IFormatProvider? provider, out Timestamp result)
Parameters
s
stringprovider
IFormatProviderresult
Timestamp