| Crates.io | umo |
| lib.rs | umo |
| version | 0.2.0 |
| created_at | 2024-12-27 04:33:28.508217+00 |
| updated_at | 2025-01-14 01:12:03.585232+00 |
| description | All open time ranges of US stock market |
| homepage | |
| repository | https://github.com/m0ssc0de/umo |
| max_upload_size | |
| id | 1496180 |
| size | 31,650 |
UMO (US Market Open) is a Rust library that provides functionality to list all open time ranges of the US stock market and check the current or next open range by a specific timestamp.
Add the following to your Cargo.toml:
[dependencies]
umo = "0.2.0"
Or cargo add umo
use umo::{get_open_ranges, pick_open_range};
fn main() {
let open_ranges = get_open_ranges();
let timestamp = 1735273592000; // Example timestamp in milliseconds
if let Some((start, end)) = pick_open_range(timestamp, &open_ranges) {
println!("Open range: {} - {}", start, end);
} else {
println!("No open range found for the given timestamp.");
}
}
This project is licensed under the MIT License.
Feel free to modify it as needed!