Method Timestamp
- Namespace
- DSharpPlus
- Assembly
- DSharpPlus.dll
Timestamp(TimeSpan, TimestampFormat)
Creates a rendered timestamp.
public static string Timestamp(TimeSpan time, TimestampFormat format = TimestampFormat.RelativeTime)
Parameters
timeTimeSpanThe time from now.
formatTimestampFormatThe format to render the timestamp in. Defaults to relative.
Returns
- string
A formatted timestamp.
Timestamp(DateTime, TimestampFormat)
Creates a rendered timestamp.
public static string Timestamp(DateTime time, TimestampFormat format = TimestampFormat.RelativeTime)
Parameters
timeDateTimeThe time from now.
formatTimestampFormatThe format to render the timestamp in. Defaults to relative.
Returns
- string
A formatted timestamp.
Timestamp(DateTimeOffset, TimestampFormat)
Creates a rendered timestamp.
public static string Timestamp(DateTimeOffset time, TimestampFormat format = TimestampFormat.RelativeTime)
Parameters
timeDateTimeOffsetTimestamp to format.
formatTimestampFormatThe format to render the timestamp in. Defaults to relative.
Returns
- string
A formatted timestamp.