Comments (1)
This is a little bit more difficult than it seems because the timestamp stored in the repodata.json
can either be in milliseconds or in seconds.
Ive use this code in the prefix backend to do the proper conversion:
/// Converts an optional timestamp that comes from repodata information to a
/// [`chrono::DateTime<Utc>`].
fn date_time_from_timestamp(timestamp: u64) -> anyhow::Result<chrono::DateTime<Utc>> {
// Convert from milliseconds to seconds
let timestamp = if timestamp > 253_402_300_799 {
timestamp / 1000
} else {
timestamp
};
Ok(chrono::DateTime::<Utc>::from_utc(
chrono::NaiveDateTime::from_timestamp_opt(timestamp as i64, 0)
.ok_or_else(|| anyhow::anyhow!("got invalid timestamp, timestamp out of range"))?,
Utc,
))
}
from rattler.
Related Issues (20)
- No progress bar while linking an environment HOT 1
- Missing fields in `PackageRecord` HOT 1
- Interoperability between the `PrefixRecord` `RepoDataRecord` `PackageRecord` HOT 1
- Deal with post-link, pre-unlink and pre-link scripts
- Functionality to create and manage `lockfiles`
- Support anaconda dev and rc channels
- Error compiling Pixi on Android for package "rattler_virtual_packages-0.12.0/src/cuda.rs" (termux from F-droid) HOT 4
- Add purls to index.json file?
- Ability to disable authentication fallback storage warning
- Either compile all `pyc` files or automatically remove them HOT 2
- Write a `conda-meta/rattler-version` file
- Extend `version.bump()` to allow bumping `minor|major|patch` HOT 5
- Case sensitive file systems make trouble HOT 1
- Consider removing unused fields (like `content_hash`) from lock files HOT 1
- Skip writing sha256_in_prefix if it is the same as the original sha256 HOT 1
- Add an win-arm64 launcher.exe
- Consolidate dependencies in workspace `Cargo.toml` HOT 2
- py-rattler: expose method to get virtual packages for a specific platform HOT 2
- Consider not copying permissions when reflinking on macOS
- System certificates are ignored with the rustls version HOT 3
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 rattler.