- All Implemented Interfaces:
QtObjectInterface
,Cloneable
,Comparable<QDateTime>
Date and time functions
Java wrapper for Qt class QDateTime
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionQDateTime
(QDate date, QTime time, Qt.TimeSpec spec) Overloaded constructor forQDateTime(io.qt.core.QDate, io.qt.core.QTime, io.qt.core.Qt.TimeSpec, int)
withoffsetSeconds = 0
.QDateTime
(QDate date, QTime time, Qt.TimeSpec spec, int offsetSeconds) SeeQDateTime::
QDateTime(QDate, QTime, Qt::TimeSpec, int) -
Method Summary
Modifier and TypeMethodDescriptionfinal QDateTime
addDays
(long days) final QDateTime
addDuration
(TemporalAmount msecs) final QDateTime
addMonths
(int months) final QDateTime
addMSecs
(long msecs) final QDateTime
addSecs
(long secs) final QDateTime
addYears
(int years) final void
clone()
Creates and returns a copy of this object.int
static QDateTime
static QDateTime
currentDateTime
(QTimeZone zone) static QDateTime
static long
static long
final QDate
date()
final long
boolean
static QDateTime
fromMSecsSinceEpoch
(long msecs) static QDateTime
fromMSecsSinceEpoch
(long msecs, QTimeZone timeZone) static QDateTime
fromMSecsSinceEpoch
(long msecs, Qt.TimeSpec spec) Overloaded function forfromMSecsSinceEpoch(long, io.qt.core.Qt.TimeSpec, int)
withoffsetFromUtc = 0
.static QDateTime
fromMSecsSinceEpoch
(long msecs, Qt.TimeSpec spec, int offsetFromUtc) SeeQDateTime::
fromMSecsSinceEpoch(qint64, Qt::TimeSpec, int) static QDateTime
fromSecsSinceEpoch
(long secs) static QDateTime
fromSecsSinceEpoch
(long secs, QTimeZone timeZone) static QDateTime
fromSecsSinceEpoch
(long secs, Qt.TimeSpec spec) Overloaded function forfromSecsSinceEpoch(long, io.qt.core.Qt.TimeSpec, int)
withoffsetFromUtc = 0
.static QDateTime
fromSecsSinceEpoch
(long secs, Qt.TimeSpec spec, int offsetFromUtc) SeeQDateTime::
fromSecsSinceEpoch(qint64, Qt::TimeSpec, int) static QDateTime
fromString
(String string) Overloaded function forfromString(java.lang.String, io.qt.core.Qt.DateFormat)
withformat = io.qt.core.Qt.DateFormat.TextDate
.static QDateTime
fromString
(String string, Qt.DateFormat format) static QDateTime
fromString
(String string, String format) Overloaded function forfromString(java.lang.String, java.lang.String, io.qt.core.QCalendar)
withcal = new io.qt.core.QCalendar()
.static QDateTime
fromString
(String string, String format, QCalendar cal) int
hashCode()
Returns the objects's hash code computed byqHash(QDateTime)
.final boolean
final boolean
isNull()
final boolean
isValid()
final Duration
Seeoperator-(QDateTime,
QDateTime) final QDateTime
minus
(TemporalAmount duration) Seeoperator-(QDateTime,
std::chrono::milliseconds) final long
final int
final QDateTime
plus
(TemporalAmount duration) Seeoperator+(QDateTime,
std::chrono::milliseconds) void
readFrom
(QDataStream arg__1) final long
final void
final void
setMSecsSinceEpoch
(long msecs) final void
setOffsetFromUtc
(int offsetSeconds) SeeQDateTime::
setOffsetFromUtc(int) final void
setSecsSinceEpoch
(long secs) final void
final void
setTimeSpec
(Qt.TimeSpec spec) SeeQDateTime::
setTimeSpec(Qt::TimeSpec) final void
setTimeZone
(QTimeZone toZone) final void
final QTime
time()
final QTimeZone
final Qt.TimeSpec
timeSpec()
final QTimeZone
timeZone()
final String
final QDateTime
final long
final QDateTime
toOffsetFromUtc
(int offsetSeconds) final long
final String
toString()
Overloaded function fortoString(io.qt.core.Qt.DateFormat)
withformat = io.qt.core.Qt.DateFormat.TextDate
.final String
toString
(Qt.DateFormat format) final String
Overloaded function fortoString(java.lang.String, io.qt.core.QCalendar)
withcal = new io.qt.core.QCalendar()
.final String
final QDateTime
toTimeSpec
(Qt.TimeSpec spec) SeeQDateTime::
toTimeSpec(Qt::TimeSpec)const final QDateTime
toTimeZone
(QTimeZone toZone) final QDateTime
toUTC()
void
writeTo
(QDataStream arg__1) Methods inherited from class io.qt.QtObject
dispose, isDisposed
-
Constructor Details
-
QDateTime
public QDateTime() -
QDateTime
- Parameters:
date
-time
-- Since:
- This function was introduced in Qt 6.5.
-
QDateTime
- Parameters:
date
-time
-timeZone
-
-
QDateTime
See
QDateTime::
QDateTime(QDate, QTime, Qt::TimeSpec, int) - Parameters:
date
-time
-spec
-offsetSeconds
-
-
QDateTime
- Parameters:
other
-
-
QDateTime
Overloaded constructor for
QDateTime(io.qt.core.QDate, io.qt.core.QTime, io.qt.core.Qt.TimeSpec, int)
withoffsetSeconds = 0
.
-
-
Method Details
-
addDays
- Parameters:
days
-- Returns:
-
addDuration
- Parameters:
msecs
-- Returns:
- Since:
- This function was introduced in Qt 6.4.
-
addMSecs
- Parameters:
msecs
-- Returns:
-
addMonths
- Parameters:
months
-- Returns:
-
addSecs
- Parameters:
secs
-- Returns:
-
addYears
- Parameters:
years
-- Returns:
-
date
- Returns:
-
daysTo
- Parameters:
arg__1
-- Returns:
-
isDaylightTime
- Returns:
-
isNull
- Returns:
-
isValid
- Returns:
-
msecsTo
- Parameters:
arg__1
-- Returns:
-
offsetFromUtc
- Returns:
-
plus
See
operator+(QDateTime,
std::chrono::milliseconds) - Parameters:
duration
-- Returns:
-
minus
See
operator-(QDateTime,
QDateTime) - Parameters:
rhs
-- Returns:
-
minus
See
operator-(QDateTime,
std::chrono::milliseconds) - Parameters:
duration
-- Returns:
-
writeTo
- Parameters:
arg__1
-
-
assign
- Parameters:
other
-
-
readFrom
- Parameters:
arg__1
-
-
secsTo
- Parameters:
arg__1
-- Returns:
-
setDate
- Parameters:
date
-
-
setMSecsSinceEpoch
- Parameters:
msecs
-
-
setOffsetFromUtc
See
QDateTime::
setOffsetFromUtc(int) - Parameters:
offsetSeconds
-
-
setSecsSinceEpoch
- Parameters:
secs
-
-
setTime
- Parameters:
time
-
-
setTimeSpec
See
QDateTime::
setTimeSpec(Qt::TimeSpec) - Parameters:
spec
-
-
setTimeZone
- Parameters:
toZone
-
-
swap
- Parameters:
other
-
-
time
- Returns:
-
timeRepresentation
- Returns:
- Since:
- This function was introduced in Qt 6.5.
-
timeSpec
- Returns:
-
timeZone
- Returns:
-
timeZoneAbbreviation
- Returns:
-
toLocalTime
- Returns:
-
toMSecsSinceEpoch
- Returns:
-
toOffsetFromUtc
- Parameters:
offsetSeconds
-- Returns:
-
toSecsSinceEpoch
- Returns:
-
toString
- Parameters:
format
-cal
-- Returns:
-
toString
- Parameters:
format
-- Returns:
-
toTimeSpec
See
QDateTime::
toTimeSpec(Qt::TimeSpec)const - Parameters:
spec
-- Returns:
-
toTimeZone
- Parameters:
toZone
-- Returns:
-
toUTC
- Returns:
-
currentDateTime
- Returns:
-
currentDateTime
- Parameters:
zone
-- Returns:
- Since:
- This function was introduced in Qt 6.5.
-
currentDateTimeUtc
- Returns:
-
currentMSecsSinceEpoch
public static long currentMSecsSinceEpoch()- Returns:
-
currentSecsSinceEpoch
public static long currentSecsSinceEpoch()- Returns:
-
fromMSecsSinceEpoch
- Parameters:
msecs
-- Returns:
- Since:
- This function was introduced in Qt 6.5.
-
fromMSecsSinceEpoch
- Parameters:
msecs
-timeZone
-- Returns:
-
fromMSecsSinceEpoch
See
QDateTime::
fromMSecsSinceEpoch(qint64, Qt::TimeSpec, int) - Parameters:
msecs
-spec
-offsetFromUtc
-- Returns:
-
fromSecsSinceEpoch
- Parameters:
secs
-- Returns:
- Since:
- This function was introduced in Qt 6.5.
-
fromSecsSinceEpoch
- Parameters:
secs
-timeZone
-- Returns:
-
fromSecsSinceEpoch
See
QDateTime::
fromSecsSinceEpoch(qint64, Qt::TimeSpec, int) - Parameters:
secs
-spec
-offsetFromUtc
-- Returns:
-
fromString
- Parameters:
string
-format
-cal
-- Returns:
- Since:
- This function was introduced in Qt 6.0.
-
fromString
- Parameters:
string
-format
-- Returns:
- Since:
- This function was introduced in Qt 6.0.
-
equals
-
compareTo
- Specified by:
compareTo
in interfaceComparable<QDateTime>
-
hashCode
Returns the objects's hash code computed byqHash(QDateTime)
. -
clone
Creates and returns a copy of this object.
-
toString
Overloaded function for
toString(java.lang.String, io.qt.core.QCalendar)
withcal = new io.qt.core.QCalendar()
. -
toString
Overloaded function for
toString(io.qt.core.Qt.DateFormat)
withformat = io.qt.core.Qt.DateFormat.TextDate
. -
fromMSecsSinceEpoch
Overloaded function for
fromMSecsSinceEpoch(long, io.qt.core.Qt.TimeSpec, int)
withoffsetFromUtc = 0
. -
fromSecsSinceEpoch
Overloaded function for
fromSecsSinceEpoch(long, io.qt.core.Qt.TimeSpec, int)
withoffsetFromUtc = 0
. -
fromString
Overloaded function for
fromString(java.lang.String, java.lang.String, io.qt.core.QCalendar)
withcal = new io.qt.core.QCalendar()
. -
fromString
Overloaded function for
fromString(java.lang.String, io.qt.core.Qt.DateFormat)
withformat = io.qt.core.Qt.DateFormat.TextDate
.
-