[#btck_set_mock_time] = btck_set_mock_time :mrdocs: Override the current time with a fixed timestamp for testing. == Synopsis Declared in `<kernel/bitcoinkernel.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[nodiscard]] int btck_set_mock_time(int64_t timestamp); ---- == Description Affects all kernel time reads globally. The caller is responsible for gating usage (e.g. restricting to regtest) if desired. The upper bound (4294967295) matches the maximum value of a block header timestamp. == Return Value 0 on success, non‐zero if timestamp is outside the valid [0, 4294967295]range. [NOTE] ==== The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^]. ==== == Parameters [cols="1,4"] |=== | Name| Description | *timestamp* [in] | Unix epoch seconds, or 0 to restore the system clock. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#