Partager via


AdvancedLicense.ExpirationDate Property

Definition

Gets or sets the date and time after which the license is not valid.

public DateTime ExpirationDate { get; set; }
member this.ExpirationDate : DateTime with get, set
Public Property ExpirationDate As DateTime

Property Value

The date and time after which the license is not valid.

Examples

private void SetExpirationDateToTomorrow(ILicenseChallenge challenge, AdvancedLicense license)
{
    license.ExpirationDate = (challenge.ClientTime != null ? challenge.ClientTime : DateTime.Now).AddHours(24);     // Note: Do not use DateTime.Now.AddHours if ClientTime is available.
}

Remarks

This property should be set as an offset to ClientTime (when available) and NOT Now. Otherwise, if the clock on the client is different than the clock on the server by even one second, an unexpected playback error may occur.

Applies to

See also