mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
cleanup: create common QDateTime -> timestamp conversion function
In analogy to the timestamp -> QDateTime conversion, create a common function. 1) For symmetry with the opposite conversion. 2) To remove numerous inconsistencies. 3) To remove use of the deprecated QDateTime::toTime_t() function. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
e33e420ef3
commit
8f80129bac
9 changed files with 19 additions and 13 deletions
|
@ -908,7 +908,7 @@ parsed:
|
|||
// add a hundred years.
|
||||
if (newDate.addYears(100) < QDateTime::currentDateTime().addYears(1))
|
||||
newDate = newDate.addYears(100);
|
||||
d->dc.when = d->when = newDate.toMSecsSinceEpoch() / 1000;
|
||||
d->dc.when = d->when = dateTimeToTimestamp(newDate);
|
||||
return true;
|
||||
}
|
||||
appendTextToLog("none of our parsing attempts worked for the date string");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue