View Source Flamel.Moment.CurrentTime (flamel v1.10.0)

Functions to get the current timestamp or DateTime - either real or mocked. These functions are intended to be used by your application code.

Summary

Functions

Freeze the current time. This only freezes the current time for the process it is called in.

Return true if the current time is mocked

Mock the current time to the specified time for the duration of the given block. This only freezes the current time for the process it is called in.

Returns either the real current timestamp or a mocked current timestamp

Unfreeze the current time

Returns either the real current DateTime.utc_now() or a mocked current DateTime

Functions

Freeze the current time. This only freezes the current time for the process it is called in.

Return true if the current time is mocked

Link to this macro

time_travel(to, list)

View Source (macro)

Mock the current time to the specified time for the duration of the given block. This only freezes the current time for the process it is called in.

Returns either the real current timestamp or a mocked current timestamp

To mock the current timestamp use the Flamel.Moment.CurrentTime.time_travel function.

Unfreeze the current time

Returns either the real current DateTime.utc_now() or a mocked current DateTime

To mock the current utc_now use the Flamel.Moment.CurrentTime.time_travel function.