-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdatetime.h
More file actions
50 lines (45 loc) · 1.26 KB
/
datetime.h
File metadata and controls
50 lines (45 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef DATETIME_H
#define DATETIME_H
#include <QMetaType>
#include <QDateTime>
#include <QSharedData>
#include "utilsexport.h"
class DateTimeData :
public QSharedData
{
public:
DateTimeData(const QDateTime &ADT, int ATZD);
DateTimeData(const DateTimeData &AOther);
public:
int tzd;
QDateTime dt;
};
class UTILS_EXPORT DateTime
{
public:
DateTime(const QString &AX85DateTime);
DateTime(const QDateTime &ADateTime = QDateTime());
~DateTime();
bool isNull() const;
bool isValid() const;
int timeZone() const;
void setTimeZone(int ASecs);
QDateTime dateTime() const;
void setDateTime(const QDateTime &ADateTime);
QDateTime toUTC() const;
QDateTime toLocal() const;
QString toX85TZD() const;
QString toX85Date() const;
QString toX85Time(bool AMSec = false) const;
QString toX85DateTime(bool AMSec = false) const;
QString toX85UTC(bool AMSec = false) const;
QString toX85Format(bool ADate, bool ATime, bool ATZD, bool AMSec = false) const;
public:
static int tzdFromX85(const QString &AX85DateTime);
static QDateTime dtFromX85(const QString &AX85DateTime);
private:
QSharedDataPointer<DateTimeData> d;
};
Q_DECLARE_METATYPE(DateTime);
#define DATETIME_METATYPE_ID qMetaTypeId<DateTime>()
#endif // DATETIME_H