Corrected the default timestamp value in multiple database schemas to ensure proper functionality and consistent formatting. Added a new asset file for the card report layout to support UI rendering for card transactions.
26 lines
697 B
C++
26 lines
697 B
C++
#include "DateUtils.h"
|
|
|
|
DateUtils::DateUtils(QObject *parent) : QObject(parent) {
|
|
}
|
|
|
|
QDateTime DateUtils::getMoscowNow() {
|
|
const QTimeZone moscowTimeZone("Europe/Moscow");
|
|
return QDateTime::currentDateTime().toTimeZone(moscowTimeZone);
|
|
}
|
|
|
|
QDateTime DateUtils::getUtcNow() {
|
|
return QDateTime::currentDateTimeUtc();
|
|
}
|
|
|
|
QDateTime DateUtils::fromUtcString(const QString ×tamp) {
|
|
QDateTime dateTime = QDateTime::fromString(timestamp, "yyyy-MM-dd HH:mm:ss");
|
|
if (dateTime.isValid()) {
|
|
dateTime.setTimeZone(QTimeZone::utc());
|
|
}
|
|
return dateTime;
|
|
}
|
|
|
|
QString DateUtils::toUtcString(const QDateTime &dateTime) {
|
|
return dateTime.toString("yyyy-MM-dd HH:mm:ss");
|
|
}
|