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.
  • 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:

In[1]:=
Click for copyable input

Verify the expiration date of the underlying persistent object:

In[2]:=
Click for copyable input
Out[2]=

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

In[1]:=
Click for copyable input

Verify the expiration date of the underlying persistent object:

In[2]:=
Click for copyable input
Out[2]=

Define a persistent value that expires immediately:

In[1]:=
Click for copyable input

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

In[2]:=
Click for copyable input
Out[2]=

Properties & Relations  (1)

See Also

AbsoluteTime  DateObject  PersistentValue  PersistenceTime

Introduced in 2017
(11.1)