Table of Contents

Class SmppTime

Namespace
Inetlab.SMPP.Common
Assembly
Inetlab.SMPP.dll

Represents time definitions described in SMPP protocol.

public static class SmppTime
Inheritance
SmppTime
Inherited Members

Methods

Format(DateTime)

Formats the given date time as absolute SMPP time.

public static string Format(DateTime dateTime)

Parameters

dateTime DateTime

The date time.

Returns

string

The formatted value.

Format(DateTimeOffset)

Formats the given date time as absolute SMPP time.

public static string Format(DateTimeOffset dateTime)

Parameters

dateTime DateTimeOffset

The date time.

Returns

string

The formatted value.

Format(TimeSpan)

Formats the given date time as SMPP time relative to SMSC local time.

public static string Format(TimeSpan timeSpan)

Parameters

timeSpan TimeSpan

The time span.

Returns

string

The formatted value.

Exceptions

ArgumentNullException

Thrown when timeSpan longer than 10000 days.

Format(TimeSpan, DateTimeOffset)

Formats the given date time as SMPP time relative to SMSC local time.

public static string Format(TimeSpan timeSpan, DateTimeOffset localTime)

Parameters

timeSpan TimeSpan

The time span.

localTime DateTimeOffset

SMSC local time.

Returns

string

The formatted value.

Exceptions

ArgumentNullException

Thrown when timeSpan longer than 10000 days.

TryParse(string, out DateTimeOffset, DateTimeOffset?)

Attempts to parse a DateTimeOffset from the given SMPP time string.

public static bool TryParse(string dateValue, out DateTimeOffset data, DateTimeOffset? localTime = null)

Parameters

dateValue string

The SMPP time string.

data DateTimeOffset

[out] The data.

localTime DateTimeOffset?

The local time for parsing given relative dateValue.

Returns

bool

True if it succeeds, false if it fails.