88 lines
1.4 KiB
C++
Executable File
88 lines
1.4 KiB
C++
Executable File
#pragma once
|
|
|
|
#include <QStringList>
|
|
#include "ngltools_export.h"
|
|
|
|
class QDateTime;
|
|
|
|
|
|
namespace DTG
|
|
{
|
|
|
|
|
|
|
|
enum DateTimeType
|
|
{
|
|
DTG = 1,
|
|
DDMMYYYY_HHMMSS_Z = 2,
|
|
DDMMYYYY_Z_HHMMSS = 4
|
|
};
|
|
|
|
|
|
|
|
|
|
enum DisplayFormat
|
|
{
|
|
Short,
|
|
Long,
|
|
TurboLong,
|
|
Default
|
|
};
|
|
|
|
enum DTGValidation
|
|
{
|
|
Invalid,
|
|
Intermediate,
|
|
Acceptable
|
|
};
|
|
|
|
|
|
|
|
NGLTOOLS_EXPORT void setDateTimeType(DateTimeType dtType);
|
|
|
|
|
|
NGLTOOLS_EXPORT DateTimeType dateTimeType();
|
|
|
|
|
|
|
|
NGLTOOLS_EXPORT void setDefaultDisplayFormat(DisplayFormat dtFormat);
|
|
|
|
|
|
NGLTOOLS_EXPORT DisplayFormat defaultDisplayFormat();
|
|
|
|
|
|
|
|
NGLTOOLS_EXPORT QString toString(const QDateTime &dt, DisplayFormat format = Default, DateTimeType = dateTimeType());
|
|
|
|
|
|
NGLTOOLS_EXPORT QString toStringMSec(qint64 msecSinceEpoch, DisplayFormat format = Default);
|
|
|
|
|
|
|
|
NGLTOOLS_EXPORT QDateTime fromDTGString(const QString &str, bool *bOk = nullptr);
|
|
|
|
|
|
NGLTOOLS_EXPORT DTGValidation validateString(const QString &str, QDateTime &dt);
|
|
|
|
|
|
|
|
NGLTOOLS_EXPORT bool setTimezone(char tz, bool bUserDefinedZone);
|
|
|
|
|
|
NGLTOOLS_EXPORT char timezone();
|
|
NGLTOOLS_EXPORT char timezoneUserDefined();
|
|
NGLTOOLS_EXPORT char timezoneExerciseDefault();
|
|
|
|
NGLTOOLS_EXPORT bool isTimezoneValid(char tz);
|
|
|
|
|
|
NGLTOOLS_EXPORT int timezone2Hours(char tz, bool *bOk = nullptr);
|
|
|
|
|
|
NGLTOOLS_EXPORT int timezone2Secs(char tz, bool *bOk = nullptr);
|
|
|
|
|
|
NGLTOOLS_EXPORT QStringList months();
|
|
|
|
}
|