Extension methods on BCL time-related types, converting to protobuf types.
Public static functions |
|
---|---|
ToDuration(this TimeSpan timeSpan)
|
Converts the given TimeSpan to a Duration.
|
ToTimestamp(this DateTime dateTime)
|
Converts the given DateTime to a Timestamp.
|
ToTimestamp(this DateTimeOffset dateTimeOffset)
|
Converts the given DateTimeOffset to a Timestamp
|
Duration ToDuration( this TimeSpan timeSpan )
Converts the given TimeSpan to a Duration.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The converted duration.
|
Timestamp ToTimestamp( this DateTime dateTime )
Converts the given DateTime to a Timestamp.
Details | |||
---|---|---|---|
Parameters |
|
||
Exceptions |
|
||
Returns |
The converted timestamp.
|
Timestamp ToTimestamp( this DateTimeOffset dateTimeOffset )
Converts the given DateTimeOffset to a Timestamp
The offset is taken into consideration when converting the value (so the same instant in time is represented) but is not a separate part of the resulting value. In other words, there is no roundtrip operation to retrieve the original DateTimeOffset
.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The converted timestamp.
|