![]() |
Qt 6.x
The Qt SDK
|
#include "qv4dateobject_p.h"
#include "qv4runtime_p.h"
#include "qv4symbol_p.h"
#include <QtCore/QDebug>
#include <QtCore/QDateTime>
#include <QtCore/private/qlocaltime_p.h>
#include <QtCore/QStringList>
#include <QtCore/QTimeZone>
#include <wtf/MathExtras.h>
Go to the source code of this file.
Functions | |
static double | TimeWithinDay (double t) |
static int | HourFromTime (double t) |
static int | MinFromTime (double t) |
static int | SecFromTime (double t) |
static int | msFromTime (double t) |
static double | Day (double t) |
static double | DaysInYear (double y) |
static double | DayFromYear (double y) |
static double | TimeFromYear (double y) |
static double | YearFromTime (double t) |
static bool | InLeapYear (double t) |
static double | DayWithinYear (double t) |
static double | MonthFromTime (double t) |
static double | DateFromTime (double t) |
static double | WeekDay (double t) |
static double | MakeTime (double hour, double min, double sec, double ms) |
static double | DayFromMonth (double month, double leap) |
static double | MakeDay (double year, double month, double day) |
static double | MakeDate (double day, double time) |
static double | DaylightSavingTA (double t, double localTZA) |
static double | LocalTime (double t, double localTZA) |
static double | UTC (double t, double localTZA) |
static double | currentTime () |
static double | TimeClip (double t) |
static double | ParseString (const QString &s, double localTZA) |
static QDateTime | ToDateTime (double t, QTimeZone zone) |
static QString | ToString (double t, double localTZA) |
static QString | ToUTCString (double t) |
static QString | ToDateString (double t) |
static QString | ToTimeString (double t) |
static QString | ToLocaleString (double t) |
static QString | ToLocaleDateString (double t) |
static QString | ToLocaleTimeString (double t) |
static double | getLocalTZA () |
DEFINE_OBJECT_VTABLE (DateObject) | |
DEFINE_OBJECT_VTABLE (DateCtor) | |
static void | addZeroPrefixedInt (QString &str, int num, int nDigits) |
Variables | |
static const double | HoursPerDay = 24.0 |
static const double | MinutesPerHour = 60.0 |
static const double | SecondsPerMinute = 60.0 |
static const double | msPerSecond = 1000.0 |
static const double | msPerMinute = 60000.0 |
static const double | msPerHour = 3600000.0 |
static const double | msPerDay = 86400000.0 |
Definition at line 1471 of file qv4dateobject.cpp.
References QString::data(), QString::resize(), QString::size(), and str.
Referenced by QV4::DatePrototype::method_toISOString().
|
inlinestatic |
Definition at line 298 of file qv4dateobject.cpp.
References QDateTime::currentDateTimeUtc(), and QDateTime::toMSecsSinceEpoch().
Referenced by QParallelAnimationGroupPrivate::_q_uncontrolledAnimationFinished(), QQuickAnimationControllerPrivate::animationCurrentTimeChanged(), QSequentialAnimationGroupPrivate::animationRemoved(), QAnimationGroupPrivate::animationRemoved(), calculateNextTimeout(), MFVideoRendererControl::customEvent(), QWasmVideoOutput::doElementCallbacks(), QQuick3DParticleEmitter::getEmitAmountFromDynamicBursts(), QSequentialAnimationGroupPrivate::indexForCurrentTime(), QV4::DatePrototype::method_now(), QVariantAnimationPrivate::recalculateCurrentInterval(), QEventDispatcherWin32::remainingTime(), QTimeLinePrivate::setCurrentTime(), QFFmpeg::Clock::setPlaybackRate(), QParallelAnimationGroupPrivate::shouldAnimationStart(), QXcbDrag::timerEvent(), QFFmpeg::Clock::timeUpdated(), QQuickParticleSystem::updateCurrentTime(), QFFmpeg::Clock::usecsTo(), QV4::DateCtor::virtualCall(), and QV4::DateCtor::virtualCallAsConstructor().
|
inlinestatic |
Definition at line 156 of file qv4dateobject.cpp.
References d, DayWithinYear(), InLeapYear(), MonthFromTime(), qt_qnan(), and QV4::Value::toInteger().
Referenced by MakeDay(), QV4::DatePrototype::method_getDate(), QV4::DatePrototype::method_getUTCDate(), QV4::DatePrototype::method_setFullYear(), QV4::DatePrototype::method_setMonth(), QV4::DatePrototype::method_setUTCFullYear(), QV4::DatePrototype::method_setUTCMonth(), QV4::DatePrototype::method_setYear(), and QV4::DatePrototype::method_toISOString().
|
inlinestatic |
Definition at line 56 of file qv4dateobject.cpp.
References msPerDay.
Referenced by DayWithinYear(), DomDate::hasElementDay(), DomDateTime::hasElementDay(), MakeDay(), QV4::DatePrototype::method_setHours(), QV4::DatePrototype::method_setMilliseconds(), QV4::DatePrototype::method_setMinutes(), QV4::DatePrototype::method_setSeconds(), QV4::DatePrototype::method_setUTCHours(), QV4::DatePrototype::method_setUTCMilliseconds(), QV4::DatePrototype::method_setUTCMinutes(), QV4::DatePrototype::method_setUTCSeconds(), ParseString(), and WeekDay().
|
inlinestatic |
Definition at line 198 of file qv4dateobject.cpp.
References qt_qnan().
Referenced by MakeDay().
|
inlinestatic |
Definition at line 75 of file qv4dateobject.cpp.
Referenced by DayWithinYear(), MakeDay(), and TimeFromYear().
|
inlinestatic |
Definition at line 278 of file qv4dateobject.cpp.
References QLocalTime::getUtcOffset().
Referenced by LocalTime(), ToString(), and UTC().
|
inlinestatic |
Definition at line 61 of file qv4dateobject.cpp.
Referenced by InLeapYear(), and YearFromTime().
|
inlinestatic |
Definition at line 107 of file qv4dateobject.cpp.
References Day(), DayFromYear(), and YearFromTime().
Referenced by DateFromTime(), and MonthFromTime().
DEFINE_OBJECT_VTABLE | ( | DateCtor | ) |
DEFINE_OBJECT_VTABLE | ( | DateObject | ) |
|
static |
Definition at line 610 of file qv4dateobject.cpp.
References QLocalTime::getCurrentStandardUtcOffset().
Referenced by QV4::DatePrototype::init(), and QV4::DatePrototype::timezoneUpdated().
|
inlinestatic |
Definition at line 32 of file qv4dateobject.cpp.
References HoursPerDay, and msPerHour.
Referenced by QV4::DatePrototype::method_getHours(), QV4::DatePrototype::method_getUTCHours(), QV4::DatePrototype::method_setMilliseconds(), QV4::DatePrototype::method_setMinutes(), QV4::DatePrototype::method_setSeconds(), QV4::DatePrototype::method_setUTCMilliseconds(), QV4::DatePrototype::method_setUTCMinutes(), QV4::DatePrototype::method_setUTCSeconds(), and QV4::DatePrototype::method_toISOString().
|
inlinestatic |
Definition at line 97 of file qv4dateobject.cpp.
References DaysInYear(), Q_ASSERT, and YearFromTime().
Referenced by DateFromTime(), MakeDay(), and MonthFromTime().
|
inlinestatic |
Definition at line 283 of file qv4dateobject.cpp.
References DaylightSavingTA().
Referenced by QV4::DatePrototype::method_getDate(), QV4::DatePrototype::method_getDay(), QV4::DatePrototype::method_getFullYear(), QV4::DatePrototype::method_getHours(), QV4::DatePrototype::method_getMilliseconds(), QV4::DatePrototype::method_getMinutes(), QV4::DatePrototype::method_getMonth(), QV4::DatePrototype::method_getSeconds(), QV4::DatePrototype::method_getTimezoneOffset(), QV4::DatePrototype::method_getYear(), QV4::DatePrototype::method_setDate(), QV4::DatePrototype::method_setFullYear(), QV4::DatePrototype::method_setHours(), QV4::DatePrototype::method_setMilliseconds(), QV4::DatePrototype::method_setMinutes(), QV4::DatePrototype::method_setMonth(), QV4::DatePrototype::method_setSeconds(), and QV4::DatePrototype::method_setYear().
|
inlinestatic |
Definition at line 256 of file qv4dateobject.cpp.
References msPerDay, and time.
Referenced by QV4::Date::init(), QV4::DatePrototype::method_setDate(), QV4::DatePrototype::method_setFullYear(), QV4::DatePrototype::method_setHours(), QV4::DatePrototype::method_setMilliseconds(), QV4::DatePrototype::method_setMinutes(), QV4::DatePrototype::method_setMonth(), QV4::DatePrototype::method_setSeconds(), QV4::DatePrototype::method_setUTCDate(), QV4::DatePrototype::method_setUTCFullYear(), QV4::DatePrototype::method_setUTCHours(), QV4::DatePrototype::method_setUTCMilliseconds(), QV4::DatePrototype::method_setUTCMinutes(), QV4::DatePrototype::method_setUTCMonth(), QV4::DatePrototype::method_setUTCSeconds(), QV4::DatePrototype::method_setYear(), QV4::DatePrototype::method_UTC(), ParseString(), and QV4::DateCtor::virtualCallAsConstructor().
|
static |
Definition at line 218 of file qv4dateobject.cpp.
References DateFromTime(), Day(), DayFromMonth(), DayFromYear(), InLeapYear(), MonthFromTime(), msPerDay, Q_ASSERT, qIsFinite(), qQNaN(), qt_qnan(), qWarning, QV4::Value::toInteger(), and YearFromTime().
Referenced by QV4::Date::init(), QV4::DatePrototype::method_setDate(), QV4::DatePrototype::method_setFullYear(), QV4::DatePrototype::method_setMonth(), QV4::DatePrototype::method_setUTCDate(), QV4::DatePrototype::method_setUTCFullYear(), QV4::DatePrototype::method_setUTCMonth(), QV4::DatePrototype::method_setYear(), QV4::DatePrototype::method_UTC(), ParseString(), and QV4::DateCtor::virtualCallAsConstructor().
|
inlinestatic |
Definition at line 187 of file qv4dateobject.cpp.
References MinutesPerHour, msPerSecond, qIsFinite(), qQNaN(), SecondsPerMinute, and QV4::Value::toInteger().
Referenced by QV4::Date::init(), QV4::DatePrototype::method_setHours(), QV4::DatePrototype::method_setMilliseconds(), QV4::DatePrototype::method_setMinutes(), QV4::DatePrototype::method_setSeconds(), QV4::DatePrototype::method_setUTCHours(), QV4::DatePrototype::method_setUTCMilliseconds(), QV4::DatePrototype::method_setUTCMinutes(), QV4::DatePrototype::method_setUTCSeconds(), QV4::DatePrototype::method_UTC(), ParseString(), and QV4::DateCtor::virtualCallAsConstructor().
|
inlinestatic |
Definition at line 38 of file qv4dateobject.cpp.
References MinutesPerHour, and msPerMinute.
Referenced by QV4::DatePrototype::method_getMinutes(), QV4::DatePrototype::method_getUTCMinutes(), QV4::DatePrototype::method_setHours(), QV4::DatePrototype::method_setMilliseconds(), QV4::DatePrototype::method_setSeconds(), QV4::DatePrototype::method_setUTCHours(), QV4::DatePrototype::method_setUTCMilliseconds(), QV4::DatePrototype::method_setUTCSeconds(), and QV4::DatePrototype::method_toISOString().
|
inlinestatic |
Definition at line 112 of file qv4dateobject.cpp.
References d, DayWithinYear(), InLeapYear(), and qt_qnan().
Referenced by DateFromTime(), MakeDay(), QV4::DatePrototype::method_getMonth(), QV4::DatePrototype::method_getUTCMonth(), QV4::DatePrototype::method_setDate(), QV4::DatePrototype::method_setFullYear(), QV4::DatePrototype::method_setUTCDate(), QV4::DatePrototype::method_setUTCFullYear(), QV4::DatePrototype::method_setYear(), and QV4::DatePrototype::method_toISOString().
|
inlinestatic |
Definition at line 50 of file qv4dateobject.cpp.
References msPerSecond.
Referenced by QV4::DatePrototype::method_getMilliseconds(), QV4::DatePrototype::method_getUTCMilliseconds(), QV4::DatePrototype::method_setHours(), QV4::DatePrototype::method_setMinutes(), QV4::DatePrototype::method_setSeconds(), QV4::DatePrototype::method_setUTCHours(), QV4::DatePrototype::method_setUTCMinutes(), QV4::DatePrototype::method_setUTCSeconds(), and QV4::DatePrototype::method_toISOString().
|
inlinestatic |
Definition at line 312 of file qv4dateobject.cpp.
References ch, Day(), error, Qt::ISODate, QDateTime::isValid(), MakeDate(), MakeDay(), MakeTime(), Q_ASSERT, QStringLiteral, qt_qnan(), Qt::RFC2822Date, Qt::TextDate, TimeClip(), QDateTime::toMSecsSinceEpoch(), QTimeZone::UTC, and UTC().
Referenced by QV4::DatePrototype::method_parse(), QV4::DateObject::stringToDateTime(), and QV4::DateCtor::virtualCallAsConstructor().
|
inlinestatic |
Definition at line 44 of file qv4dateobject.cpp.
References msPerSecond, and SecondsPerMinute.
Referenced by QV4::DatePrototype::method_getSeconds(), QV4::DatePrototype::method_getUTCSeconds(), QV4::DatePrototype::method_setHours(), QV4::DatePrototype::method_setMilliseconds(), QV4::DatePrototype::method_setMinutes(), QV4::DatePrototype::method_setUTCHours(), QV4::DatePrototype::method_setUTCMilliseconds(), QV4::DatePrototype::method_setUTCMinutes(), and QV4::DatePrototype::method_toISOString().
|
inlinestatic |
Definition at line 303 of file qv4dateobject.cpp.
References qt_is_finite(), qt_qnan(), and QV4::Value::toInteger().
Referenced by QV4::DateObject::dateTimeToString(), QV4::DatePrototype::method_UTC(), and ParseString().
|
inlinestatic |
Definition at line 83 of file qv4dateobject.cpp.
References DayFromYear(), and msPerDay.
Referenced by YearFromTime().
|
inlinestatic |
Definition at line 26 of file qv4dateobject.cpp.
References msPerDay.
Referenced by QV4::DatePrototype::method_setDate(), QV4::DatePrototype::method_setFullYear(), QV4::DatePrototype::method_setMonth(), QV4::DatePrototype::method_setUTCDate(), QV4::DatePrototype::method_setUTCFullYear(), QV4::DatePrototype::method_setUTCMonth(), and QV4::DatePrototype::method_setYear().
|
inlinestatic |
Definition at line 585 of file qv4dateobject.cpp.
References QDateTime::date(), QTimeZone::LocalTime, and ToDateTime().
Referenced by QV4::DatePrototype::method_toDateString().
Converts the ECMA Date value t (in UTC form) to QDateTime according to spec.
Definition at line 551 of file qv4dateobject.cpp.
References QDateTime::fromMSecsSinceEpoch(), and QDateTime::toTimeZone().
Referenced by QV4::DateObject::stringToDateTime(), ToDateString(), ToLocaleDateString(), ToLocaleString(), ToLocaleTimeString(), QV4::Date::toQDateTime(), ToString(), ToTimeString(), and ToUTCString().
|
inlinestatic |
Definition at line 600 of file qv4dateobject.cpp.
References date, QTimeZone::LocalTime, QLocale::ShortFormat, ToDateTime(), and QLocale::toString().
Referenced by QV4::DatePrototype::method_toLocaleDateString().
|
inlinestatic |
Definition at line 595 of file qv4dateobject.cpp.
References QTimeZone::LocalTime, QLocale::ShortFormat, ToDateTime(), and QLocale::toString().
Referenced by QV4::DatePrototype::method_toLocaleString().
|
inlinestatic |
Definition at line 605 of file qv4dateobject.cpp.
References QTimeZone::LocalTime, QLocale::ShortFormat, time, ToDateTime(), and QLocale::toString().
Referenced by QV4::DatePrototype::method_toLocaleTimeString().
|
inlinestatic |
Definition at line 558 of file qv4dateobject.cpp.
References QString::append(), DaylightSavingTA(), QTimeZone::LocalTime, QString::number(), QStringLiteral, str, and ToDateTime().
Referenced by QV4::DateObject::dateTimeToString(), QV4::DatePrototype::method_toString(), QV4::DateObject::toString(), and QV4::DateCtor::virtualCall().
|
inlinestatic |
Definition at line 590 of file qv4dateobject.cpp.
References QTimeZone::LocalTime, QDateTime::time(), and ToDateTime().
Referenced by QV4::DatePrototype::method_toTimeString().
|
inlinestatic |
Definition at line 578 of file qv4dateobject.cpp.
References QStringLiteral, ToDateTime(), and QTimeZone::UTC.
Referenced by QV4::DatePrototype::method_toUTCString().
|
inlinestatic |
Definition at line 292 of file qv4dateobject.cpp.
References DaylightSavingTA().
Referenced by QV4::Date::init(), QV4::DatePrototype::method_setDate(), QV4::DatePrototype::method_setFullYear(), QV4::DatePrototype::method_setHours(), QV4::DatePrototype::method_setMilliseconds(), QV4::DatePrototype::method_setMinutes(), QV4::DatePrototype::method_setMonth(), QV4::DatePrototype::method_setSeconds(), QV4::DatePrototype::method_setYear(), ParseString(), and QV4::DateCtor::virtualCallAsConstructor().
|
inlinestatic |
Definition at line 180 of file qv4dateobject.cpp.
References Day().
Referenced by QV4::DatePrototype::method_getDay(), QV4::DatePrototype::method_getUTCDay(), and QDateTimeParser::setDigit().
|
inlinestatic |
Definition at line 88 of file qv4dateobject.cpp.
References DaysInYear(), msPerDay, t2, and TimeFromYear().
Referenced by DayWithinYear(), InLeapYear(), MakeDay(), QV4::DatePrototype::method_getFullYear(), QV4::DatePrototype::method_getUTCFullYear(), QV4::DatePrototype::method_getYear(), QV4::DatePrototype::method_setDate(), QV4::DatePrototype::method_setMonth(), QV4::DatePrototype::method_setUTCDate(), QV4::DatePrototype::method_setUTCMonth(), and QV4::DatePrototype::method_toISOString().
|
static |
Definition at line 18 of file qv4dateobject.cpp.
Referenced by HourFromTime().
|
static |
Definition at line 19 of file qv4dateobject.cpp.
Referenced by MakeTime(), and MinFromTime().
|
static |
Definition at line 24 of file qv4dateobject.cpp.
Referenced by Day(), MakeDate(), MakeDay(), TimeFromYear(), TimeWithinDay(), and YearFromTime().
|
static |
Definition at line 23 of file qv4dateobject.cpp.
Referenced by HourFromTime().
|
static |
Definition at line 22 of file qv4dateobject.cpp.
Referenced by QV4::DatePrototype::method_getTimezoneOffset(), and MinFromTime().
|
static |
Definition at line 21 of file qv4dateobject.cpp.
Referenced by MakeTime(), msFromTime(), and SecFromTime().
|
static |
Definition at line 20 of file qv4dateobject.cpp.
Referenced by MakeTime(), and SecFromTime().