Updated blocktime format

This commit is contained in:
Andre Jochems
2016-06-09 15:01:47 +02:00
parent dfb03115eb
commit b3cbb74700
2 changed files with 9 additions and 5 deletions

View File

@@ -88,19 +88,19 @@
<number>15</number>
</property>
<property name="verticalSpacing">
<number>10</number>
<number>12</number>
</property>
<property name="leftMargin">
<number>10</number>
</property>
<property name="topMargin">
<number>10</number>
<number>5</number>
</property>
<property name="rightMargin">
<number>10</number>
</property>
<property name="bottomMargin">
<number>10</number>
<number>5</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="lblBlockHeight">
@@ -170,7 +170,7 @@
<string notr="true">-</string>
</property>
<property name="wordWrap">
<bool>true</bool>
<bool>false</bool>
</property>
</widget>
</item>

View File

@@ -4,6 +4,7 @@
#include "clientmodel.h"
#include "bitcoinrpc.h"
#include <QDateTime>
#include <QDebug>
#include "bitcoinunits.h"
#include "main.h"
#include "overviewpage.h"
@@ -55,7 +56,10 @@ void InfoPage::setNumBlocks(int count, int countOfPeers)
// block height changed so update all possible values as well
if(clientModel)
{
ui->txtLastBlockTime->setText(clientModel->getLastBlockDate().toString());
QDateTime blockTime = clientModel->getLastBlockDate().toTimeSpec(Qt::UTC);
QString formattedBlockTime = blockTime.toString("dd-MM-yyyy HH:mm:ss");
formattedBlockTime.append(" UTC");
ui->txtLastBlockTime->setText(formattedBlockTime);
ui->txtDifficulty->setText(QString::number(GetDifficulty()));
ui->txtCoinSupply->setText(BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, GetTotalCoinSupply(count, false)));
double megaHash = GetNetworkHashRate(-1, count) / 1000000;