Table of Contents

Class EpochExtensions

Namespace
Serilog.Sinks.Splunk
Assembly
Serilog.Sinks.Splunk.dll

Provides extension methods for DateTimeOffset to convert to epoch time.

public static class EpochExtensions
Inheritance
EpochExtensions
Inherited Members

Methods

ToEpoch(DateTimeOffset, SubSecondPrecision)

Converts a DateTimeOffset value to epoch time with specified sub-second precision.

public static string ToEpoch(this DateTimeOffset value, SubSecondPrecision subSecondPrecision = SubSecondPrecision.Milliseconds)

Parameters

value DateTimeOffset

The DateTimeOffset value to convert.

subSecondPrecision SubSecondPrecision

Timestamp sub-second precision.

Returns

string

The epoch time representation of the DateTimeOffset value.