KD SOAP API Documentation 2.2
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
KDDateTime Class Reference

#include <KDDateTime.h>

Inheritance diagram for KDDateTime:
Inheritance graph
[legend]
Collaboration diagram for KDDateTime:
Collaboration graph
[legend]

Public Member Functions

 KDDateTime ()
 
 KDDateTime (const KDDateTime &)
 
 KDDateTime (const QDateTime &)
 
 ~KDDateTime ()
 
 operator QVariant () const
 
KDDateTimeoperator= (const KDDateTime &)
 
void setTimeZone (const QString &timeZone)
 
QString timeZone () const
 
QString toDateString () const
 
- Public Member Functions inherited from QDateTime
 QDateTime ()
 
 QDateTime (const QDate &date)
 
 QDateTime (const QDate &date, const QTime &time, const QTimeZone &timeZone)
 
 QDateTime (const QDate &date, const QTime &time, Qt::TimeSpec spec)
 
 QDateTime (const QDate &date, const QTime &time, Qt::TimeSpec spec, int offsetSeconds)
 
 QDateTime (const QDateTime &other)
 
 QDateTime (QDateTime &&other)
 
 ~QDateTime ()
 
QDateTime addDays (qint64 ndays) const const
 
QDateTime addMonths (int nmonths) const const
 
QDateTime addMSecs (qint64 msecs) const const
 
QDateTime addSecs (qint64 s) const const
 
QDateTime addYears (int nyears) const const
 
QDate date () const const
 
qint64 daysTo (const QDateTime &other) const const
 
bool isDaylightTime () const const
 
bool isNull () const const
 
bool isValid () const const
 
qint64 msecsTo (const QDateTime &other) const const
 
int offsetFromUtc () const const
 
bool operator!= (const QDateTime &other) const const
 
bool operator< (const QDateTime &other) const const
 
QDataStreamoperator<< (QDataStream &out, const QDateTime &dateTime)
 
bool operator<= (const QDateTime &other) const const
 
QDateTimeoperator= (const QDateTime &other)
 
bool operator== (const QDateTime &other) const const
 
bool operator> (const QDateTime &other) const const
 
bool operator>= (const QDateTime &other) const const
 
QDataStreamoperator>> (QDataStream &in, QDateTime &dateTime)
 
qint64 secsTo (const QDateTime &other) const const
 
void setDate (const QDate &date)
 
void setMSecsSinceEpoch (qint64 msecs)
 
void setOffsetFromUtc (int offsetSeconds)
 
void setSecsSinceEpoch (qint64 secs)
 
void setTime (const QTime &time)
 
void setTime_t (uint seconds)
 
void setTimeSpec (Qt::TimeSpec spec)
 
void setTimeZone (const QTimeZone &toZone)
 
void swap (QDateTime &other)
 
QTime time () const const
 
Qt::TimeSpec timeSpec () const const
 
QTimeZone timeZone () const const
 
QString timeZoneAbbreviation () const const
 
CFDateRef toCFDate () const const
 
QDateTime toLocalTime () const const
 
qint64 toMSecsSinceEpoch () const const
 
NSDate * toNSDate () const const
 
QDateTime toOffsetFromUtc (int offsetSeconds) const const
 
qint64 toSecsSinceEpoch () const const
 
QString toString (const QString &format) const const
 
QString toString (const QString &format, QCalendar cal) const const
 
QString toString (QStringView format) const const
 
QString toString (QStringView format, QCalendar cal) const const
 
QString toString (Qt::DateFormat format) const const
 
uint toTime_t () const const
 
QDateTime toTimeSpec (Qt::TimeSpec spec) const const
 
QDateTime toTimeZone (const QTimeZone &timeZone) const const
 
QDateTime toUTC () const const
 

Static Public Member Functions

static KDDateTime fromDateString (const QString &s)
 
- Static Public Member Functions inherited from QDateTime
QDateTime currentDateTime ()
 
QDateTime currentDateTimeUtc ()
 
qint64 currentMSecsSinceEpoch ()
 
qint64 currentSecsSinceEpoch ()
 
QDateTime fromCFDate (CFDateRef date)
 
QDateTime fromMSecsSinceEpoch (qint64 msecs)
 
QDateTime fromMSecsSinceEpoch (qint64 msecs, const QTimeZone &timeZone)
 
QDateTime fromMSecsSinceEpoch (qint64 msecs, Qt::TimeSpec spec, int offsetSeconds)
 
QDateTime fromNSDate (const NSDate *date)
 
QDateTime fromSecsSinceEpoch (qint64 secs, const QTimeZone &timeZone)
 
QDateTime fromSecsSinceEpoch (qint64 secs, Qt::TimeSpec spec, int offsetSeconds)
 
QDateTime fromString (const QString &string, const QString &format, QCalendar cal)
 
QDateTime fromString (const QString &string, Qt::DateFormat format)
 
QDateTime fromTime_t (uint seconds)
 
QDateTime fromTime_t (uint seconds, const QTimeZone &timeZone)
 
QDateTime fromTime_t (uint seconds, Qt::TimeSpec spec, int offsetSeconds)
 

Additional Inherited Members

- Public Types inherited from QDateTime
enum  YearRange
 
- Public Attributes inherited from QDateTime
 First
 
 Last
 

Detailed Description

A DateTime class with an additional (optional) timezone.

As specified in https://www.w3.org/TR/xmlschema-2/#dateTime, the timezone can be empty (local time), "Z" (for UTC) or an offset from UTC like "+05:00" or "-03:00"

Definition at line 27 of file KDDateTime.h.

Constructor & Destructor Documentation

◆ KDDateTime() [1/3]

KDDateTime::KDDateTime ( )

Definition at line 20 of file KDDateTime.cpp.

◆ KDDateTime() [2/3]

KDDateTime::KDDateTime ( const KDDateTime rhs)

Definition at line 25 of file KDDateTime.cpp.

◆ KDDateTime() [3/3]

KDDateTime::KDDateTime ( const QDateTime rhs)

Implicit constructor from a QDateTime. Sets the timeZone to "local", i.e. empty

Definition at line 31 of file KDDateTime.cpp.

◆ ~KDDateTime()

KDDateTime::~KDDateTime ( )

Definition at line 46 of file KDDateTime.cpp.

Member Function Documentation

◆ fromDateString()

KDDateTime KDDateTime::fromDateString ( const QString s)
static

Creates a KDDateTime from a SOAP-compliant string representation.

Definition at line 88 of file KDDateTime.cpp.

References QString::chop(), QString::endsWith(), QString::fromLatin1(), QDateTime::fromString(), Qt::ISODate, QString::right(), setTimeZone(), and QString::startsWith().

◆ operator QVariant()

KDDateTime::operator QVariant ( ) const

Converts the KDDateTime to QVariant, to avoid implicit conversion to base QDateTime.

Since
1.8

Definition at line 50 of file KDDateTime.cpp.

References QVariant::fromValue().

◆ operator=()

KDDateTime & KDDateTime::operator= ( const KDDateTime rhs)

Definition at line 37 of file KDDateTime.cpp.

References QDateTime::operator=().

◆ setTimeZone()

void KDDateTime::setTimeZone ( const QString timeZone)

◆ timeZone()

QString KDDateTime::timeZone ( ) const

Returns the time zone set by setTimeZone.

Definition at line 55 of file KDDateTime.cpp.

Referenced by setTimeZone().

◆ toDateString()

QString KDDateTime::toDateString ( ) const

Returns a SOAP-compliant string representation of the date/time object.

Definition at line 109 of file KDDateTime.cpp.

References Qt::ISODate, QDateTime::time(), and QDateTime::toString().

Referenced by variantToTextValue().


The documentation for this class was generated from the following files:

© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
https://www.kdab.com/development-resources/qt-tools/kd-soap/
Generated on Sat Apr 20 2024 00:04:25 for KD SOAP API Documentation by doxygen 1.9.8