- All Implemented Interfaces:
QtObjectInterface
,Cloneable
,Comparable<QDateTime>
Date and time functions
Java wrapper for Qt class QDateTime
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Java wrapper for Qt enumQDateTime::TransitionResolution
static enum
Java wrapper for Qt enumQDateTime::YearRange
-
Constructor Summary
ConstructorDescriptionOverloaded constructor forQDateTime(io.qt.core.QDate, io.qt.core.QTime, io.qt.core.QDateTime.TransitionResolution)
withresolve = io.qt.core.QDateTime.TransitionResolution.LegacyBehavior
.Overloaded constructor forQDateTime(io.qt.core.QDate, io.qt.core.QTime, io.qt.core.QTimeZone, io.qt.core.QDateTime.TransitionResolution)
withresolve = io.qt.core.QDateTime.TransitionResolution.LegacyBehavior
.QDateTime
(QDate date, QTime time, QTimeZone timeZone, QDateTime.TransitionResolution resolve) QDateTime
(QDate date, QTime time, QDateTime.TransitionResolution resolve) QDateTime
(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) -
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) 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) 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, int)
withbaseYear = io.qt.core.QLocale.DefaultTwoDigitBaseYear
.static QDateTime
fromString
(String string, String format, int baseYear) static QDateTime
fromString
(String string, String format, int baseYear, 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
Overloaded function forsetDate(io.qt.core.QDate, io.qt.core.QDateTime.TransitionResolution)
withresolve = io.qt.core.QDateTime.TransitionResolution.LegacyBehavior
.final void
setDate
(QDate date, QDateTime.TransitionResolution resolve) final void
setMSecsSinceEpoch
(long msecs) final void
setOffsetFromUtc
(int offsetSeconds) final void
setSecsSinceEpoch
(long secs) final void
Overloaded function forsetTime(io.qt.core.QTime, io.qt.core.QDateTime.TransitionResolution)
withresolve = io.qt.core.QDateTime.TransitionResolution.LegacyBehavior
.final void
setTime
(QTime time, QDateTime.TransitionResolution resolve) final void
setTimeSpec
(Qt.TimeSpec spec) final void
setTimeZone
(QTimeZone toZone) Overloaded function forsetTimeZone(io.qt.core.QTimeZone, io.qt.core.QDateTime.TransitionResolution)
withresolve = io.qt.core.QDateTime.TransitionResolution.LegacyBehavior
.final void
setTimeZone
(QTimeZone toZone, QDateTime.TransitionResolution resolve) 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
final String
final QDateTime
toTimeSpec
(Qt.TimeSpec spec) 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
-resolve
-- Since:
- This function was introduced in Qt 6.5.
-
QDateTime
public QDateTime(QDate date, QTime time, QTimeZone timeZone, QDateTime.TransitionResolution resolve) - Parameters:
date
-time
-timeZone
-resolve
-
-
QDateTime
- Parameters:
date
-time
-spec
-offsetSeconds
-
-
QDateTime
- Parameters:
other
-
-
QDateTime
Overloaded constructor for
QDateTime(io.qt.core.QDate, io.qt.core.QTime, io.qt.core.QDateTime.TransitionResolution)
withresolve = io.qt.core.QDateTime.TransitionResolution.LegacyBehavior
. -
QDateTime
Overloaded constructor for
QDateTime(io.qt.core.QDate, io.qt.core.QTime, io.qt.core.QTimeZone, io.qt.core.QDateTime.TransitionResolution)
withresolve = io.qt.core.QDateTime.TransitionResolution.LegacyBehavior
. -
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
-resolve
-
-
setMSecsSinceEpoch
- Parameters:
msecs
-
-
setOffsetFromUtc
- Parameters:
offsetSeconds
-
-
setSecsSinceEpoch
- Parameters:
secs
-
-
setTime
- Parameters:
time
-resolve
-
-
setTimeSpec
- Parameters:
spec
-
-
setTimeZone
@QtUninvokable public final void setTimeZone(QTimeZone toZone, QDateTime.TransitionResolution resolve) - Parameters:
toZone
-resolve
-
-
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
-- Returns:
-
toString
- Parameters:
format
-cal
-- Returns:
-
toString
- Parameters:
format
-- Returns:
-
toTimeSpec
- 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:
-
fromMSecsSinceEpoch
- Parameters:
msecs
-timeZone
-- Returns:
-
fromMSecsSinceEpoch
- Parameters:
msecs
-spec
-offsetFromUtc
-- Returns:
-
fromSecsSinceEpoch
- Parameters:
secs
-- Returns:
-
fromSecsSinceEpoch
- Parameters:
secs
-timeZone
-- Returns:
-
fromSecsSinceEpoch
- Parameters:
secs
-spec
-offsetFromUtc
-- Returns:
-
fromString
- Parameters:
string
-format
-baseYear
-- Returns:
- Since:
- This function was introduced in Qt 6.7.
-
fromString
- Parameters:
string
-format
-baseYear
-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.
-
setDate
Overloaded function for
setDate(io.qt.core.QDate, io.qt.core.QDateTime.TransitionResolution)
withresolve = io.qt.core.QDateTime.TransitionResolution.LegacyBehavior
. -
setTime
Overloaded function for
setTime(io.qt.core.QTime, io.qt.core.QDateTime.TransitionResolution)
withresolve = io.qt.core.QDateTime.TransitionResolution.LegacyBehavior
. -
setTimeZone
Overloaded function for
setTimeZone(io.qt.core.QTimeZone, io.qt.core.QDateTime.TransitionResolution)
withresolve = io.qt.core.QDateTime.TransitionResolution.LegacyBehavior
. -
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, int)
withbaseYear = io.qt.core.QLocale.DefaultTwoDigitBaseYear
. -
fromString
Overloaded function for
fromString(java.lang.String, io.qt.core.Qt.DateFormat)
withformat = io.qt.core.Qt.DateFormat.TextDate
.
-