Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qv4dateobject.cpp File Reference

(22df353c14800d2e9b6d57a9a0cb9c6baa337999)

#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>
Include dependency graph for qv4dateobject.cpp:

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

Function Documentation

◆ addZeroPrefixedInt()

void addZeroPrefixedInt ( QString & str,
int num,
int nDigits )
static

Definition at line 1534 of file qv4dateobject.cpp.

◆ currentTime()

double currentTime ( )
inlinestatic

Definition at line 299 of file qv4dateobject.cpp.

◆ DateFromTime()

double DateFromTime ( double t)
inlinestatic

Definition at line 157 of file qv4dateobject.cpp.

References DayWithinYear(), and InLeapYear().

Referenced by MakeDay().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Day()

double Day ( double t)
inlinestatic

Definition at line 57 of file qv4dateobject.cpp.

References msPerDay.

Referenced by DayWithinYear(), MakeDay(), and WeekDay().

Here is the caller graph for this function:

◆ DayFromMonth()

double DayFromMonth ( double month,
double leap )
inlinestatic

Definition at line 199 of file qv4dateobject.cpp.

Referenced by MakeDay().

Here is the caller graph for this function:

◆ DayFromYear()

double DayFromYear ( double y)
inlinestatic

Definition at line 76 of file qv4dateobject.cpp.

Referenced by DayWithinYear(), MakeDay(), and TimeFromYear().

Here is the caller graph for this function:

◆ DaylightSavingTA()

double DaylightSavingTA ( double t,
double localTZA )
inlinestatic

Definition at line 279 of file qv4dateobject.cpp.

Referenced by LocalTime(), ToString(), and UTC().

Here is the caller graph for this function:

◆ DaysInYear()

double DaysInYear ( double y)
inlinestatic

Definition at line 62 of file qv4dateobject.cpp.

Referenced by InLeapYear(), and YearFromTime().

Here is the caller graph for this function:

◆ DayWithinYear()

double DayWithinYear ( double t)
inlinestatic

Definition at line 108 of file qv4dateobject.cpp.

References Day(), DayFromYear(), and YearFromTime().

Referenced by DateFromTime(), and MonthFromTime().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DEFINE_OBJECT_VTABLE() [1/2]

DEFINE_OBJECT_VTABLE ( DateCtor )

◆ DEFINE_OBJECT_VTABLE() [2/2]

DEFINE_OBJECT_VTABLE ( DateObject )

◆ getLocalTZA()

double getLocalTZA ( )
static

Definition at line 611 of file qv4dateobject.cpp.

◆ HourFromTime()

int HourFromTime ( double t)
inlinestatic

Definition at line 33 of file qv4dateobject.cpp.

References HoursPerDay, and msPerHour.

◆ InLeapYear()

bool InLeapYear ( double t)
inlinestatic

Definition at line 98 of file qv4dateobject.cpp.

References DaysInYear(), and YearFromTime().

Referenced by DateFromTime(), MakeDay(), and MonthFromTime().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LocalTime()

double LocalTime ( double t,
double localTZA )
inlinestatic

Definition at line 284 of file qv4dateobject.cpp.

References DaylightSavingTA().

Here is the call graph for this function:

◆ MakeDate()

double MakeDate ( double day,
double time )
inlinestatic

Definition at line 257 of file qv4dateobject.cpp.

References msPerDay.

Referenced by ParseString().

Here is the caller graph for this function:

◆ MakeDay()

double MakeDay ( double year,
double month,
double day )
static

Definition at line 219 of file qv4dateobject.cpp.

References DateFromTime(), Day(), DayFromMonth(), DayFromYear(), InLeapYear(), MonthFromTime(), msPerDay, and YearFromTime().

Referenced by ParseString().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MakeTime()

double MakeTime ( double hour,
double min,
double sec,
double ms )
inlinestatic

Definition at line 188 of file qv4dateobject.cpp.

References MinutesPerHour, msPerSecond, and SecondsPerMinute.

Referenced by ParseString().

Here is the caller graph for this function:

◆ MinFromTime()

int MinFromTime ( double t)
inlinestatic

Definition at line 39 of file qv4dateobject.cpp.

References MinutesPerHour, and msPerMinute.

◆ MonthFromTime()

double MonthFromTime ( double t)
inlinestatic

Definition at line 113 of file qv4dateobject.cpp.

References DayWithinYear(), and InLeapYear().

Referenced by MakeDay().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ msFromTime()

int msFromTime ( double t)
inlinestatic

Definition at line 51 of file qv4dateobject.cpp.

References msPerSecond.

◆ ParseString()

double ParseString ( const QString & s,
double localTZA )
inlinestatic

Definition at line 313 of file qv4dateobject.cpp.

References MakeDate(), MakeDay(), MakeTime(), TimeClip(), and UTC().

Here is the call graph for this function:

◆ SecFromTime()

int SecFromTime ( double t)
inlinestatic

Definition at line 45 of file qv4dateobject.cpp.

References msPerSecond, and SecondsPerMinute.

◆ TimeClip()

double TimeClip ( double t)
inlinestatic

Definition at line 304 of file qv4dateobject.cpp.

Referenced by ParseString().

Here is the caller graph for this function:

◆ TimeFromYear()

double TimeFromYear ( double y)
inlinestatic

Definition at line 84 of file qv4dateobject.cpp.

References DayFromYear(), and msPerDay.

Referenced by YearFromTime().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TimeWithinDay()

double TimeWithinDay ( double t)
inlinestatic

Definition at line 27 of file qv4dateobject.cpp.

References msPerDay.

◆ ToDateString()

QString ToDateString ( double t)
inlinestatic

Definition at line 586 of file qv4dateobject.cpp.

◆ ToDateTime()

QDateTime ToDateTime ( double t,
QTimeZone zone )
inlinestatic

Converts the ECMA Date value t (in UTC form) to QDateTime according to spec.

Definition at line 552 of file qv4dateobject.cpp.

◆ ToLocaleDateString()

QString ToLocaleDateString ( double t)
inlinestatic

Definition at line 601 of file qv4dateobject.cpp.

◆ ToLocaleString()

QString ToLocaleString ( double t)
inlinestatic

Definition at line 596 of file qv4dateobject.cpp.

◆ ToLocaleTimeString()

QString ToLocaleTimeString ( double t)
inlinestatic

Definition at line 606 of file qv4dateobject.cpp.

◆ ToString()

QString ToString ( double t,
double localTZA )
inlinestatic

Definition at line 559 of file qv4dateobject.cpp.

References DaylightSavingTA().

Here is the call graph for this function:

◆ ToTimeString()

QString ToTimeString ( double t)
inlinestatic

Definition at line 591 of file qv4dateobject.cpp.

◆ ToUTCString()

QString ToUTCString ( double t)
inlinestatic

Definition at line 579 of file qv4dateobject.cpp.

◆ UTC()

double UTC ( double t,
double localTZA )
inlinestatic

Definition at line 293 of file qv4dateobject.cpp.

References DaylightSavingTA().

Referenced by ParseString().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WeekDay()

double WeekDay ( double t)
inlinestatic

Definition at line 181 of file qv4dateobject.cpp.

References Day().

Here is the call graph for this function:

◆ YearFromTime()

double YearFromTime ( double t)
inlinestatic

Definition at line 89 of file qv4dateobject.cpp.

References DaysInYear(), msPerDay, and TimeFromYear().

Referenced by DayWithinYear(), InLeapYear(), and MakeDay().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ HoursPerDay

const double HoursPerDay = 24.0
static

Definition at line 19 of file qv4dateobject.cpp.

Referenced by HourFromTime().

◆ MinutesPerHour

const double MinutesPerHour = 60.0
static

Definition at line 20 of file qv4dateobject.cpp.

Referenced by MakeTime(), and MinFromTime().

◆ msPerDay

const double msPerDay = 86400000.0
static

Definition at line 25 of file qv4dateobject.cpp.

Referenced by Day(), MakeDate(), MakeDay(), TimeFromYear(), TimeWithinDay(), and YearFromTime().

◆ msPerHour

const double msPerHour = 3600000.0
static

Definition at line 24 of file qv4dateobject.cpp.

Referenced by HourFromTime().

◆ msPerMinute

const double msPerMinute = 60000.0
static

Definition at line 23 of file qv4dateobject.cpp.

Referenced by MinFromTime().

◆ msPerSecond

const double msPerSecond = 1000.0
static

Definition at line 22 of file qv4dateobject.cpp.

Referenced by MakeTime(), msFromTime(), and SecFromTime().

◆ SecondsPerMinute

const double SecondsPerMinute = 60.0
static

Definition at line 21 of file qv4dateobject.cpp.

Referenced by MakeTime(), and SecFromTime().