4 releases

0.1.16-alpha.0 Mar 31, 2023
0.1.13-alpha.0 Mar 17, 2023
0.1.12-alpha.0 Jan 18, 2023
0.1.10-alpha.0 Jan 17, 2023

#23 in #median

Download history 170/week @ 2024-05-20 115/week @ 2024-05-27 129/week @ 2024-06-03 128/week @ 2024-06-10 172/week @ 2024-06-17 188/week @ 2024-06-24 118/week @ 2024-07-08 223/week @ 2024-07-15 119/week @ 2024-07-22 125/week @ 2024-07-29 165/week @ 2024-08-05 116/week @ 2024-08-12 117/week @ 2024-08-19 155/week @ 2024-08-26 115/week @ 2024-09-02

543 downloads per month
Used in 87 crates (12 directly)

MIT license

270KB
735 lines

bitcoin-time

The bitcoin-time crate is a direct translation of the Bitcoin codebase from C++ to Rust, providing a suite of time-related tools and utilities for the Bitcoin system. This crate includes functions for converting time between various formats (chrono_sanity_check, of, format_iso8601date, format_iso8601date_time, parse_iso8601date_time, etc.), as well as functions for measuring and manipulating time (count_microseconds, count_milliseconds, count_seconds, count_seconds_double, set_mock_time, uninterruptible_sleep, etc.).

While there may not be any specific mathematical equations or concepts involved in the bitcoin-time crate, the correct handling and manipulation of time is essential to the proper functioning of the Bitcoin system. This crate is currently in the process of translation, and it's possible that some function bodies are still being translated.

This crate also includes various helpers and filters (MedianFilter, median, sorted, get_adjusted_datetime, etc.) to assist with accurate and precise time manipulation. Additionally, there are functions for retrieving and setting system time (get_time, get_time_micros_since_epoch, get_time_millis_since_epoch, get_time_seconds_since_epoch, get_time_since_epoch, etc.), as well as functions for retrieving the maximum Unix timestamp (max_unix_timestamp) and the time offset (get_time_offset).

Dependencies

~88MB
~848K SLoC