Skip to content

Commit f2ca357

Browse files
committed
Fixed Excel Date Offset
1 parent 6dc2389 commit f2ca357

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ members = ["cli-excel-rs", "crates/*", "py-excel-rs"]
33
resolver = "2"
44

55
[workspace.package]
6-
version = "0.5.2"
6+
version = "0.5.3"
77
authors = ["Carl Voller"]
88
edition = "2021"
99
homepage = "https://github.com/carlvoller/excel-rs"
1010
license = "MIT"
1111
repository = "https://github.com/carlvoller/excel-rs"
1212

1313
[workspace.dependencies]
14-
excel-rs-xlsx = { version = "0.5.2", path = "crates/excel-rs-xlsx", default-features = false }
15-
excel-rs-csv = { version = "0.5.2", path = "crates/excel-rs-csv", default-features = false }
16-
excel-rs-postgres = { version = "0.5.2", path = "crates/excel-rs-postgres", default-features = false }
14+
excel-rs-xlsx = { version = "0.5.3", path = "crates/excel-rs-xlsx", default-features = false }
15+
excel-rs-csv = { version = "0.5.3", path = "crates/excel-rs-csv", default-features = false }
16+
excel-rs-postgres = { version = "0.5.3", path = "crates/excel-rs-postgres", default-features = false }
1717

1818
[profile.release]
1919
opt-level = 3

py-excel-rs/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "maturin"
44

55
[project]
66
name = "py-excel-rs"
7-
version = "0.5.2"
7+
version = "0.5.3"
88
description = "Some performant utility functions to convert common data structures to XLSX"
99
dependencies = ["pandas", "numpy"]
1010
requires-python = ">=3.7"

py-excel-rs/src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ pub fn chrono_to_xlsx_date(date: NaiveDateTime) -> f64 {
1616
);
1717
let delta = (date - start_date).num_nanoseconds().unwrap();
1818

19-
let true_delta: f64 = delta as f64 / NANOSECONDS_IN_A_DAY;
19+
let true_delta: f64 = (delta as f64 + NANOSECONDS_IN_A_DAY + NANOSECONDS_IN_A_DAY) / NANOSECONDS_IN_A_DAY;
2020
return true_delta;
2121
}

0 commit comments

Comments
 (0)