Comments (2)
In the future, if anyone needs:
use chrono::{TimeZone, Utc, DateTime};
let your_epoch = Utc.with_ymd_and_hms(2014, 9, 1, 0, 0, 0);
let parts = decompose(id);
Utc.timestamp_nanos(your_epoch.timestamp_nanos_opt().unwrap() + parts.nanos_time())
from sonyflake-rs.
Released with 0.2
, thanks @negezor for putting in the work!
from sonyflake-rs.
Related Issues (9)
- RUSTSEC-2018-0015: term is looking for a new maintainer HOT 1
- Simple next_id benchmark
- Decompose into struct
- RUSTSEC-2020-0071: Potential segfault in the time crate HOT 1
- RUSTSEC-2020-0159: Potential segfault in `localtime_r` invocations HOT 1
- next_id repeat in a loop HOT 2
- Doesn't work with Rust 1.72.0 + x86-64-windows-gnu toolchain HOT 3
- Test `Error::OverTimeLimit`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sonyflake-rs.