HistoryExport: write the date column in UTC by munzzyy · Pull Request #313 · feather-wallet/feather · GitHub
Skip to content

HistoryExport: write the date column in UTC - #313

Open
munzzyy wants to merge 1 commit into
feather-wallet:masterfrom
munzzyy:historyexport-utc-date
Open

munzzyy wants to merge 1 commit into
feather-wallet:masterfrom
munzzyy:historyexport-utc-date

Conversation

@munzzyy

@munzzyy munzzyy commented Oct 7, 2026

Copy link
Copy Markdown

Fixes #312

The history CSV export builds the date column from the local date and time and then tacks a literal Z on the end. On any machine that isn't set to UTC, date disagrees with the timestamp column next to it. For timestamp 1704067200 on a UTC+02:00 machine it writes 2024-01-01T02:00:00Z instead of 2024-01-01T00:00:00Z.

This builds the string with tx.timestamp.toUTC().toString(Qt::ISODate) instead, the line skaravos suggested in #312. It gives the same YYYY-MM-DDTHH:MM:SSZ shape as before, just actually in UTC.

I checked the old and new expressions in a small Qt 6 program with QDateTime::fromSecsSinceEpoch(1704067200):

TZ=Europe/Berlin    old: 2024-01-01T01:00:00Z  new: 2024-01-01T00:00:00Z
TZ=America/Chicago  old: 2023-12-31T18:00:00Z  new: 2024-01-01T00:00:00Z
TZ=Asia/Kolkata     old: 2024-01-01T05:30:00Z  new: 2024-01-01T00:00:00Z

I did not build the full Feather tree here (the monero submodule isn't checked out on my machine), so the dialog itself is untested.

The min/max date filter in the same function still compares local dates, which is what the date pickers show, so I left it alone. TransactionRow::date() and time() have no other callers after this, I left them in to keep the diff to one line.

One thing to be aware of: anyone who already parses the old CSV and strips the Z will see their times shift by their UTC offset, since the old values were local.

The date column was built from the local date and time with a literal Z
appended, so on any non-UTC system it disagreed with the timestamp column
(UTC+02:00 gave 2024-01-01T02:00:00Z for timestamp 1704067200). Convert to
UTC before formatting.

Fixes feather-wallet#312
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: CSV export labels local datetimes as UTC

1 participant