Skip to content

qt: Fix usage of QDateTime::fromSecsSinceEpoch

Summary

MR !1015 (merged) ended up causing a regression where builds on Qt 5.5 stopped working (such as Ubuntu Xenial). The breakage was due to QDateTime::fromSecsSinceEpoch being used, which was introduced in Qt 5.8, however Xenial is on 5.5. This MR instead uses QDateTime::fromMSecsSinceEpoch which is available since Qt 4.7, and should compile ok on Qt 5.5

For convenience the GUIUtils function dateTimeFromTime() has been added which handles the conversion from time -> msecs such that we don't have to ensure qint64 and also don't have to multiply by 1000 at every call site.

This MR closes #274 (closed).

Test Plan

  1. ninja all check
  2. Run Bitcoin-Qt and look around the GUI -- all date and times should appear correct / not broken. (Open up the "Information" window too).
    • All tx histories should have correct dates, as should all tx detail screens
  3. Compile on Ubuntu Xenial and you should get no build failures.
Edited by Calin Culianu

Merge request reports