Account: set "accountStartTime"

This commit is contained in:
Siegfried Siegert 2023-07-19 20:46:38 +02:00
parent 3c235d2ec1
commit 33445c1249
Signed by: SiegfriedSiegert
GPG Key ID: 68371E015E8F0B03

View File

@ -276,6 +276,32 @@ void ATBDeviceControllerPlugin::private_getAccountData()
accountData.insert("AccountingNumber", QString::number(retVR.AccountingNumber)); accountData.insert("AccountingNumber", QString::number(retVR.AccountingNumber));
// build dateTime: -------------------------------------------------------
// Example: "2023-07-19T18:24:01.063+02:00"
QString startDateTimeString;
QString formatString = "yyyy-MM-ddThh:mm:ss";
uint year = retVR.year + 2000;
startDateTimeString.append(QString::number(year)).append("-");
uint month = retVR.month;
startDateTimeString.append(QString::number(month).rightJustified(2, '0')).append("-");
uint day = retVR.dom;
startDateTimeString.append(QString::number(day).rightJustified(2, '0')).append("T");
uint hour = retVR.hour;
startDateTimeString.append(QString::number(hour).rightJustified(2, '0')).append(":");
uint minute = retVR.min;
startDateTimeString.append(QString::number(minute).rightJustified(2, '0')).append(":");
uint seconds = retVR.sec;
startDateTimeString.append(QString::number(seconds).rightJustified(2, '0'));
qCritical() << " startDateTimeString = " << startDateTimeString;
QDateTime startDateTime = QDateTime::fromString(startDateTimeString, formatString);
accountData.insert("accountStartTime", startDateTime);
//-------------------------------------------------------------------------
int numberOfCoinVariants = sizeof(retVR.coinsInVault); int numberOfCoinVariants = sizeof(retVR.coinsInVault);
// DEBUG // DEBUG