{"id":16856333,"url":"https://github.com/kijewski/utcnow","last_synced_at":"2025-03-22T06:31:08.099Z","repository":{"id":48628727,"uuid":"516931370","full_name":"Kijewski/utcnow","owner":"Kijewski","description":"Get the current unixtime in a no-std context","archived":false,"fork":false,"pushed_at":"2024-12-12T02:21:27.000Z","size":91,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T08:53:35.253Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://docs.rs/utcnow","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kijewski.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-23T01:45:51.000Z","updated_at":"2024-12-12T02:19:27.000Z","dependencies_parsed_at":"2023-12-18T22:55:16.292Z","dependency_job_id":"f8f5c82e-b3dd-422f-9843-76c4a5a7dfd9","html_url":"https://github.com/Kijewski/utcnow","commit_stats":{"total_commits":47,"total_committers":3,"mean_commits":"15.666666666666666","dds":"0.25531914893617025","last_synced_commit":"b717298ee0c5f1024a41faea362b58c14dabc580"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kijewski%2Futcnow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kijewski%2Futcnow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kijewski%2Futcnow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kijewski%2Futcnow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kijewski","download_url":"https://codeload.github.com/Kijewski/utcnow/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244918500,"owners_count":20531682,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T14:03:40.904Z","updated_at":"2025-03-22T06:31:07.233Z","avatar_url":"https://github.com/Kijewski.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# utcnow — Get the current unixtime in a no-std context\n\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/Kijewski/utcnow/ci.yml?branch=main)](https://github.com/Kijewski/utcnow/actions/workflows/ci.yml)\n[![Crates.io](https://img.shields.io/crates/v/utcnow?logo=rust)](https://crates.io/crates/utcnow)\n![Minimum supported Rust version](https://img.shields.io/badge/rustc-1.48-important?logo=rust \"Minimum Supported Rust Version\")\n[![License](https://img.shields.io/crates/l/utcnow?color=informational\u0026logo=apache)](/LICENSE.md)\n\nThis library solves one question, and one question only: *What's the time?*\n\nIn [UTC](https://en.wikipedia.org/w/index.php?title=Coordinated_Universal_Time\u0026oldid=1099753328 \"Coordinated Universal Time\"), and\naccording to the clock of the PC, tablet, toaster … the library runs on,\nexpressed as seconds + nanoseconds since [`1970-01-01`](https://en.wikipedia.org/w/index.php?title=Unix_time\u0026oldid=1099912565 \"Unix time\").\n\n```rust\nlet now = utcnow().unwrap();\nlet seconds = now.as_secs();\nlet nanos = now.subsec_nanos();\n```\n\nFor many target platforms this call cannot fail.\nIf this is true for the current target, then the constant `INFALLIBLE` will be `true`.\n\nIf the target platform is not supported, then `utcnow()` will always return an error instead of failing to compile.\nUse the library with `default-features = false` and without the feature `fallback` to get a compile-time error instead.\n\nThe feature `std` (enabled by default) is only needed if you need the `Error` type to implement `std::error::Error`.\n\n### Supported platforms\n\nIf you have successfully tested one of the untested targets, then please [tell me](https://github.com/Kijewski/utcnow/issues).\nAnd if not, then even more so!\n\nIf you know how to implement another target, then please open a [pull request](https://github.com/Kijewski/utcnow/pulls).\n\n**Supported and tested:**\n\n* Android\n* Emscripten\n* FreeBSD\n* Haiku\n* Illumos\n* Linux\n* Linux with Musl\n* MacOS\n* NetBSD\n* WASI\n* wasm32\n* Windows\n\n**(Probably) supported, but not actually tested:**\n\n* Darwin\n* Dragonfly\n* Fuchsia\n* iOS\n* OpenBSD\n* Redox\n* Solaris\n\nIncreasing the \u003cabbr title=\"Minimum Supported Rust Version\"\u003emsrv\u003c/abbr\u003e for [tier-2](https://doc.rust-lang.org/nightly/rustc/platform-support.html) or\nlower platforms will not be indicated as a breaking change to the semver version.\n\n### Feature flags\n\n`utcnow` has the following optional features:\n\n* `serde`, which implements [`serde::Deserialize`](https://docs.rs/serde/1/serde/trait.Deserialize.html)\n   and [`serde::Serialize`](https://docs.rs/serde/1/serde/trait.Serialize.html) for `UtcTime`.\n\n* `arbitrary`, which implements the [`arbitrary::Arbitrary`](https://docs.rs/arbitrary/1/arbitrary/trait.Arbitrary.html) trait for `UtcTime`.\n\n* `proptest`, which implements the [`proptest::arbitrary::Arbitrary`](https://docs.rs/proptest/1/proptest/arbitrary/trait.Arbitrary.html) trait for `UtcTime`.\n\n* `quickcheck`, which implements the [`quickcheck::Arbitrary`](https://docs.rs/quickcheck/1/quickcheck/trait.Arbitrary.html) trait for `UtcTime`.\n\n* `rkyv`, which implements the [`rkyv::Archive`](https://docs.rs/rkyv/0.7/rkyv/trait.Archive.html),\n  [`rkyv::Serialize`](https://docs.rs/rkyv/0.7/rkyv/trait.Serialize.html),\n  and [`rkyv::Deserialize`](https://docs.rs/rkyv/0.7/rkyv/trait.Deserialize.html) for `UtcTime`.\n\n* `castaway`, which implements the [`castaway::LifetimeFree`](https://docs.rs/castaway/0.2/castaway/trait.LifetimeFree.html)\n  trait for `UtcTime`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkijewski%2Futcnow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkijewski%2Futcnow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkijewski%2Futcnow/lists"}