ExpirationDate

ExpirationDate

is an option for various functions that specifies when a persistent value should be treated as expired.

Details

  • ExpirationDate can be used for PersistentValue and InitializationValue.
  • Values can be given as absolute times or date and time specifications.
  • The value Infinity () or None can be used to specify that a persistent value should never expire.
  • An expired persistent value is treated as nonexistent, and the underlying persistent object may be removed.

Examples

open allclose all

Basic Examples  (3)

Define a persistent value that expires at the beginning of the year 2020:

Verify the expiration date of the underlying persistent object:

Define a persistent value that expires at the beginning of next year:

Verify the expiration date of the underlying persistent object:

Define a persistent value that expires immediately:

Accessing an expired persistent value behaves as if it did not exist:

Properties & Relations  (1)

Values specified with PersistenceTime are converted to absolute expiration dates:

Introduced in 2017
 (11.1)