Table of Contents

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

time TimeSpan

The time from now.

format TimestampFormat

The 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

time DateTime

The time from now.

format TimestampFormat

The 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

time DateTimeOffset

Timestamp to format.

format TimestampFormat

The format to render the timestamp in. Defaults to relative.

Returns

string

A formatted timestamp.