Our great sponsors
-
timecop
A gem providing "time travel", "time freezing", and "time acceleration" capabilities, making it simple to test time-dependent code. It provides a unified method to mock Time.now, Date.today, and DateTime.now in a single call.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
* in C++.
On Python, just use freezegun to inject controllable timestamps in response to calls to time methods.
https://github.com/spulec/freezegun
The Ruby equivalent is Timecop
https://github.com/travisjeffery/timecop
Dynamic languages have the advantage to be able to rewrite the standard library classes at runtime.
Freezegun is pretty much unmaintained. You want time-machine https://github.com/adamchainz/time-machine