Skip to content

channelCache.getDate

Signature: channelCache.getDate(key, defaultValue*)

Returns: Date dateValue - the value associated with the Date-typed key

Get the Date-typed value associated with the key.

Note

A ClassCastException will be thrown if the cache is not of type Date.

Parameters

Type Name Description Default
String key a unique string used to identify the cached value
Date defaultValue* (optional) the value to return if no value is associated with the key null

Example

// Get a Date value from the channel cache
var cutoffDate = channelCache.getDate("cutoffStartDate"); // Date

// Get a Date value with a default if the key does not exist
var startDate = channelCache.getDate("missingDateKey", new Date()); // Date