is an option for various functions that specifies when a persistent value should be treated as expired.
ExpirationDate
is an option for various functions that specifies when a persistent value should be treated as expired.
Details
- ExpirationDate can be used for PersistentSymbol and InitializationValue.
- Values can be given as absolute times or date and time specifications.
- Numerical values are treated as values given by UnixTime.
- 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 all close allBasic Examples (4)
Define a persistent value that expires at the beginning of the year 2024:
PersistentSymbol["e1", ExpirationDate -> DateObject[{2024}]] = 1;Verify the expiration date of the underlying persistent object:
PersistentObject["e1", $PersistenceBase]["ExpirationDate"]Define a persistent value that expires at the beginning of next year:
PersistentSymbol["e2", ExpirationDate -> NextDate["Year"]] = 2;Verify the expiration date of the underlying persistent object:
PersistentObject["e2", $PersistenceBase]["ExpirationDate"]Define a persistent value that expires immediately:
PersistentSymbol["e3", ExpirationDate -> Now] = 2;Accessing an expired persistent value behaves as if it did not exist:
PersistentSymbol["e3"]The default setting for ExpirationDate is to never expire:
PersistentSymbol["Eternal"] = 42;PersistentObject["Eternal", $PersistenceBase]["ExpirationDate"]Properties & Relations (1)
Values specified with PersistenceTime are converted to absolute expiration dates:
PersistentSymbol["x", "KernelSession", PersistenceTime -> 5] = 1;PersistentObject["x", "KernelSession"]["ExpirationDate"]History
Text
Wolfram Research (2017), ExpirationDate, Wolfram Language function, https://reference.wolfram.com/language/ref/ExpirationDate.html.
CMS
Wolfram Language. 2017. "ExpirationDate." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ExpirationDate.html.
APA
Wolfram Language. (2017). ExpirationDate. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ExpirationDate.html
BibTeX
@misc{reference.wolfram_2026_expirationdate, author="Wolfram Research", title="{ExpirationDate}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/ExpirationDate.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_expirationdate, organization={Wolfram Research}, title={ExpirationDate}, year={2017}, url={https://reference.wolfram.com/language/ref/ExpirationDate.html}, note=[Accessed: 12-June-2026]}