Simulated Today

"Simulated Today" allows the system to perceive "current system date" as a specified date, without physically changing the OS system date.

This can be very useful in testing and demo scenarios. It allows you to get consistent results with date-sensitive functionality such as TimelineViews and Time-Based Workflows. Once Simulated Today has been set, the entirety of the application behaves as if "today" was the given date. (Note however that "time of day" is still derived from your system clock.)

"Simulated Today" is not recommended for use in production.

Configuration

To enable the "Simulated Today" feature, you must perform a one-time setup first. Set the property "simulatedtoday.enabled" to true in your node.properties and run the installer (or in a local environment, set the same property in your local.properties and build).

Configuring the Date of Simulated Today

To set "Simulated Today" to a specific date, a menu option is available to the InstanceAdminUser under the "Utilities" menu. Using this UI page, provide the desired date in "YYYYMMDD" format. A server restart is not required.

To clear the Simulated Today value and re-assume the system clock, delete your value from the "Today Is" field and save.

When simulatedtoday.enabled is false, "Simulated Today" value is not considered even if it is set. The Admin UI page is disabled for changes.

Database

The SIMULATED_TODAY table supports a single row with a single column TODAY_IS to persist the "Simulated Today" value. The functions SIMULATED_TIMESTAMP and SIMULATED_DATE are provided in lieu of SYSTIMESTAMP and SYSDATE. These new functions return simulated date values instead of original system date.

Platform automatically converts SYSTIMESTAMP to SIMULATED_TIMESTAMP and SYSDATE to SIMULATED_DATE when executing SQL via SqlService or ModelDataService. Therefore, it is not necessary for modules to rewrite SQL Defs to call the new functions. However, Platform is unable to change the contents of stored procedures or functions. Therefore, module authors should use SIMULATED_TIMESTAMP and SIMULATED_TODAY in those functions, even if they are not concerned with simulating dates. (These functions fallback automatically on SYSTIMESTAMP/SYSDATE when Simulated Today is disabled.)

Midnight Transition - when the system clock moves from 11:59 PM to 12:00 AM, the current date does not advance when Simulated Today is enabled. In other words, if the Simulated Today date is January 3rd, then at 11:59 PM system clock time it will be 11:59 PM January 3rd, and when it advances to 12:00 AM it will be 12:00 AM January 3rd.

Database

The SIMULATED_TODAY table supports a single row with a single column TODAY_IS to persist the "Simulated Today" value. The functions SIMULATED_TIMESTAMP and SIMULATED_DATE are provided in lieu of SYSTIMESTAMP and SYSDATE. These new functions return simulated date values instead of original system date.

Platform automatically converts SYSTIMESTAMP to SIMULATED_TIMESTAMP and SYSDATE to SIMULATED_DATE when executing SQL via SqlService or ModelDataService. Therefore, it is not necessary for modules to rewrite SQL Defs to call the new functions. However, Platform is unable to change the contents of stored procedures or functions. Therefore, module authors should use SIMULATED_TIMESTAMP and SIMULATED_TODAY in those functions, even if they are not concerned with simulating dates. (These functions fallback automatically on SYSTIMESTAMP/SYSDATE when Simulated Today is disabled.)

Midnight Transition - when the system clock moves from 11:59 PM to 12:00 AM, the current date does not advance when Simulated Today is enabled. In other words, if the Simulated Today date is January 3rd, then at 11:59 PM system clock time it will be 11:59 PM January 3rd, and when it advances to 12:00 AM it will be 12:00 AM January 3rd.