4#include "qplatformdefs.h" 
    5#include "private/qdatetimeparser_p.h" 
   14#include "private/qlocale_p.h" 
   16#include "private/qstringiterator_p.h" 
   17#include "private/qtenvironmentvariables_p.h" 
   20#if defined (QDATETIMEPARSER_DEBUG) && !defined(QT_NO_DEBUG_STREAM) 
   21#  define QDTPDEBUG qDebug() 
   22#  define QDTPDEBUGN qDebug 
   24#  define QDTPDEBUG if (false) qDebug() 
   25#  define QDTPDEBUGN if (false) qDebug 
   51        qWarning(
"QDateTimeParser::getDigit() Internal error (%ls %d)",
 
   73    qWarning(
"QDateTimeParser::getDigit() Internal error 2 (%ls %d)",
 
   89    const int diff = sought - held;
 
   90    return diff < -3 ? diff + 7 : diff > 3 ? diff - 7 : diff;
 
   97    for (
const auto &node : nodes) {
 
  121        qWarning(
"QDateTimeParser::setDigit() Internal error (%ls %d %d)",
 
  126    const QDate oldDate = 
v.date();
 
  131    enum { NoFix, MonthDay, 
WeekDay } fixDay = NoFix;
 
  161        if (newVal > 7 || newVal <= 0)
 
  173    case AmPmSection: hour = (newVal == 0 ? hour % 12 : (hour % 12) + 12); 
break;
 
  175        qWarning(
"QDateTimeParser::setDigit() Internal error (%ls)",
 
  189            if (newDoW > 0 && newDoW <= 7)
 
  195    if (fixDay != NoFix) {
 
  207    const QTime newTime(hour, minute, second, msec);
 
  252        return int(UpperCase);
 
  256    qWarning(
"QDateTimeParser::absoluteMax() Internal error (%ls)",
 
  289    qWarning(
"QDateTimeParser::absoluteMin() Internal error (%ls, %0x)",
 
  302    if (sectionIndex < 0) {
 
  303        switch (sectionIndex) {
 
  315    qWarning(
"QDateTimeParser::sectionNode() Internal error (%d)",
 
  384    for (
int i=0; 
i<max; ++
i) {
 
  388            else if (!
ret.isEmpty() && 
str.
at(
i - 1) == slash)
 
  409                                   int from, 
int size, 
int lastQuote)
 
  438    const int max = newFormat.
size();
 
  440    for (
i = 0; 
i<max; ++
i) {
 
  446            else if (
i > 0 && newFormat.
at(
i - 1) != slash)
 
  448        } 
else if (status != 
quote) {
 
  456                    newSectionNodes.
append(sn);
 
  466                    newSectionNodes.
append(sn);
 
  476                    newSectionNodes.
append(sn);
 
  488                    newSectionNodes.
append(sn);
 
  499                    Case caseOpt = sect == 
'A' ? UpperCase : LowerCase;
 
  502                    if (
i + 1 < newFormat.
size()
 
  505                        if (newFormat.
at(
i) != 
QLatin1Char(caseOpt == UpperCase ? 
'P' : 
'p'))
 
  506                            caseOpt = NativeCase;
 
  509                    newSectionNodes.
append(sn);
 
  518                                                 i - 
add, repeat == 4 ? 4 : 2, 0 };
 
  519                        newSectionNodes.
append(sn);
 
  523                        newDisplay |= sn.
type;
 
  530                    newSectionNodes.
append(sn);
 
  543                    newSectionNodes.
append(sn);
 
  547                    newDisplay |= sn.
type;
 
  554                    newSectionNodes.
append(sn);
 
  570        const int count = newSectionNodes.
size();
 
  581        newSeparators.append(
QString());
 
  607    if (sectionIndex < 0)
 
  611        qWarning(
"QDateTimeParser::sectionSize Internal error (%d)", sectionIndex);
 
  620        int sizeAdjustment = 0;
 
  624            int preceedingZeroesAdded = 0;
 
  627                const auto end = 
begin + sectionIndex;
 
  628                for (
auto sectionIt = 
begin; sectionIt != 
end; ++sectionIt)
 
  629                    preceedingZeroesAdded += sectionIt->zeroesAdded;
 
  631            sizeAdjustment = preceedingZeroesAdded;
 
  642int QDateTimeParser::sectionMaxSize(Section 
s, 
int count)
 const 
  644#if QT_CONFIG(textdate) 
  668#if QT_CONFIG(textdate) 
  673#if QT_CONFIG(textdate) 
  681            for (
int i=1; 
i<=mcount; ++
i) {
 
  700        return std::numeric_limits<int>::max();
 
  710        qWarning(
"QDateTimeParser::sectionMaxSize: Invalid section %s",
 
  724int QDateTimeParser::sectionMaxSize(
int index)
 const 
  727    return sectionMaxSize(sn.
type, sn.
count);
 
  752QString QDateTimeParser::sectionText(
int sectionIndex)
 const 
  758QDateTimeParser::ParsedSection
 
  764               "QDateTimeParser::parseSection", 
"Internal error");
 
  766    const int sectionmaxsize = sectionMaxSize(sectionIndex);
 
  769    const int negativeYearOffset = negate ? 1 : 0;
 
  779    QDTPDEBUG << 
"sectionValue for" << sn.name()
 
  781              << 
") st:" << sectionTextRef;
 
  785        QString sectiontext = sectionTextRef.toString();
 
  787        const int ampm = findAmPm(sectiontext, sectionIndex, &used);
 
  801            QDTPDEBUG << 
"invalid because findAmPm(" << sectiontext << 
") returned -1";
 
  804            QDTPDEBUGN(
"This should never happen (findAmPm returned %d)", ampm);
 
  811        result = findTimeZone(sectionTextRef, defaultValue,
 
  819            QString sectiontext = sectionTextRef.toString();
 
  820            int num = 0, used = 0;
 
  825                num = findMonth(sectiontext.
toLower(), min, sectionIndex, year, §iontext, &used);
 
  827                num = findDay(sectiontext.
toLower(), 1, sectionIndex, §iontext, &used);
 
  833                if (used == sectiontext.
size())
 
  848        int used = negativeYearOffset;
 
  850        if (sectionTextRef.startsWith(u
'-')
 
  851            || sectionTextRef.startsWith(u
'+')) {
 
  852            if (
separators.at(sectionIndex + 1).startsWith(sectionTextRef[0]))
 
  867            for (; digitsStr.
size(); digitsStr.
chop(1)) {
 
  870                if (!
ok || (negate ? -value < absMin : value > absMax))
 
  882                used += digitsStr.
size();
 
  888                if (
sep.startsWith(sectionTextRef[0])
 
  892                    QDTPDEBUG << 
"invalid because" << sectionTextRef << 
"can't become a uint" 
  898                const bool unfilled = used - negativeYearOffset < sectionmaxsize;
 
  900                    for (
int i = used; 
i < sectionmaxsize; ++
i)
 
  904                Q_ASSERT(negate ? lastVal >= absMin : lastVal <= absMax);
 
  905                if (negate ? lastVal > absMax : lastVal < absMin) {
 
  909                        QDTPDEBUG << 
"invalid because" << lastVal << 
"is greater than absoluteMax" 
  912                        QDTPDEBUG << 
"invalid because" << lastVal << 
"is less than absoluteMin" 
  918                        const int missingZeroes = sectionmaxsize - digitsStr.
size();
 
  932        qWarning(
"QDateTimeParser::parseSection Internal error (%ls %d)",
 
  953    const int maxDay = 
calendar.daysInMonth(month, year); 
 
  954    day = maxDay > 1 ? 
qBound(1, day, maxDay) : 
qMax(1, day);
 
  956    return day <= 0 ? day + 7 : maxDay > 0 && day > maxDay ? day - 7 : day;
 
  968                        int year, 
int year2digits, 
int month, 
int day, 
int dayofweek)
 
  971    if (actual.
isValid() && year % 100 == year2digits && 
calendar.dayOfWeek(actual) == dayofweek)
 
  974    if (dayofweek < 1 || dayofweek > 7) 
 
  978    if (year % 100 != year2digits) {
 
  981            year += year2digits - year % 100;
 
  984            year2digits = year % 100;
 
  987    Q_ASSERT(year % 100 == year2digits);
 
  992    } 
else if (month > 12) {
 
 1007        const int diff = (dayofweek - 
calendar.dayOfWeek(
first) - last) % 7;
 
 1020    } 
else if (day > 
calendar.maximumDaysInMonth()) {
 
 1032        || 
calendar.dayOfWeek(actual) == dayofweek 
 
 1058        for (
int m = 1; 
m < 12; 
m++) {
 
 1061                if (
calendar.dayOfWeek(actual) == dayofweek)
 
 1064            if (
m + month <= 12) {
 
 1066                if (
calendar.dayOfWeek(actual) == dayofweek)
 
 1085            if (
calendar.dayOfWeek(actual) == dayofweek)
 
 1088            if (
calendar.dayOfWeek(actual) == dayofweek)
 
 1092            for (
int y = 1; 
y < 12; 
y++) {
 
 1094                if (
calendar.dayOfWeek(actual) == dayofweek)
 
 1097                if (
calendar.dayOfWeek(actual) == dayofweek)
 
 1112                        int hour, 
int hour12, 
int ampm,
 
 1113                        int minute, 
int second, 
int msec)
 
 1116    QTime actual(hour, minute, second, msec);
 
 1117    if (hour12 < 0 || hour12 > 12) { 
 
 1127            hour = hour12 + (hour > 12 ? 12 : 0);
 
 1130        if (hour - hour12 == ampm * 12)
 
 1135            hour = hour12 + ampm * 12;
 
 1138    actual = 
QTime(hour, minute, second, msec);
 
 1147    for (
int i = 0; 
i < 2; ++
i) {
 
 1149        if (
name.startsWith(zone))
 
 1159QDateTimeParser::scanString(
const QDateTime &defaultValue, 
bool fixup)
 const 
 1162    bool conflicts = 
false;
 
 1166    int year, month, day;
 
 1167    const QDate defaultDate = defaultValue.
date();
 
 1168    const QTime defaultTime = defaultValue.
time();
 
 1169    defaultDate.
getDate(&year, &month, &day);
 
 1170    int year2digits = year % 100;
 
 1171    int hour = defaultTime.
hour();
 
 1173    int minute = defaultTime.
minute();
 
 1174    int second = defaultTime.
second();
 
 1175    int msec = defaultTime.
msec();
 
 1187                      << 
"!=" << separator
 
 1193        int *current = 
nullptr;
 
 1200                                          month, day, dayofweek);
 
 1206                  << 
"pos" << 
pos << 
"used" << sect.used << 
stateName(sect.state);
 
 1208        padding += sect.zeroes;
 
 1209        if (fixup && sect.state == 
Intermediate && sect.used < sn.count) {
 
 1214                sect.used = sn.
count;
 
 1225            current = &zoneOffset;
 
 1226            if (sect.used > 0) {
 
 1234                const bool isUtc = zoneName == 
"Z"_L1 || zoneName == 
"UTC"_L1;
 
 1236                if (isUtc || isUtcOffset) {
 
 1239#if QT_CONFIG(timezone) 
 1242                        timeZone = namedZone;
 
 1263        case DaySection: current = &day; sect.value = qMax<int>(1, sect.value); 
break;
 
 1266            qWarning(
"QDateTimeParser::parse Internal error (%ls)",
 
 1278        if (isSet & sn.type && *current != sect.value) {
 
 1279            QDTPDEBUG << 
"CONFLICT " << sn.name() << *current << sect.value;
 
 1284        *current = sect.value;
 
 1299                year = (year / 100) * 100;
 
 1300                year += year2digits;
 
 1305                    year = (year / 100) * 100;
 
 1306                    year += year2digits;
 
 1322                QDTPDEBUG << year << month << day << dayofweek
 
 1327        bool needfixday = 
false;
 
 1348                for (
int i=0; 
i<sectionNodesCount; ++
i) {
 
 1371                ampm = !hasHour || hour < 12 ? 0 : 1;
 
 1372            hour12 = hour12 % 12 + ampm * 12;
 
 1375            else if (hour != hour12)
 
 1377        } 
else if (ampm != -1) {
 
 1380            else if ((ampm == 0) != (hour < 12))
 
 1385    QDTPDEBUG << year << month << day << hour << minute << second << msec;
 
 1389    const QTime time(hour, minute, second, msec);
 
 1396        case QMetaType::QDateTime: {
 
 1405                return StateNode(replace, 
state, padding, conflicts);
 
 1408        case QMetaType::QDate:
 
 1412        case QMetaType::QTime:
 
 1416            Q_UNREACHABLE_RETURN(StateNode());
 
 1420    return StateNode(when, 
state, padding, conflicts);
 
 1429                       const QDateTime &defaultValue, 
bool fixup)
 const 
 1436    StateNode scan = scanString(defaultValue, fixup);
 
 1438               scan.
value.toString(
"yyyy/MM/dd hh:mm:ss.zzz"_L1).toLatin1().constData(),
 
 1444            if (scan.
value >= minimum)
 
 1445                qWarning(
"QDateTimeParser::parse Internal error 3 (%ls %ls)",
 
 1451            for (
int i=0; 
i<sectionNodesCount && !
done; ++
i) {
 
 1454                if ((
t.size() < sectionMaxSize(
i)
 
 1456                    || 
t.contains(space)) {
 
 1459                        switch (findAmPm(
t, 
i)) {
 
 1471                        case PossibleBoth: {
 
 1473                            if (
copy >= minimum && 
copy <= maximum) {
 
 1481                        if (sn.
count >= 3) {
 
 1484                            int tmp = finalMonth;
 
 1486                            while ((tmp = findMonth(
t, tmp + 1, 
i, when.
year(
calendar))) != -1) {
 
 1488                                if (
copy >= minimum && 
copy <= maximum)
 
 1517                        if (toMin > maxChange) {
 
 1518                            QDTPDEBUG << 
"invalid because toMin > maxChange" << toMin
 
 1519                                      << maxChange << 
t << scan.
value << minimum;
 
 1523                        } 
else if (toMax > maxChange) {
 
 1529                            qWarning(
"QDateTimeParser::parse Internal error 4 (%ls)",
 
 1538                        if (pos < 0 || pos >= 
t.size())
 
 1540                        if (!potentialValue(
t.simplified(), min, max, 
i, scan.
value, 
pos)) {
 
 1541                            QDTPDEBUG << 
"invalid because potentialValue(" << 
t.simplified() << min << max
 
 1542                                      << sn.
name() << 
"returned" << toMax << toMin << 
pos;
 
 1556                Q_ASSERT(maximum.date().toJulianDay() == 5373484);
 
 1559            } 
else if (scan.
value > maximum) {
 
 1563            QDTPDEBUG << 
"not checking intermediate because scanned value is" << scan.
value << minimum << maximum;
 
 1595    for (
int n = 0; 
n < entries.
size(); ++
n)
 
 1604        if (
i > bestCount || (
i == bestCount && 
i == 
name.size())) {
 
 1611    if (usedText && bestMatch != -1)
 
 1612        *usedText = entries.
at(bestMatch);
 
 1625int QDateTimeParser::findMonth(
const QString &str1, 
int startMonth, 
int sectionIndex,
 
 1626                               int year, 
QString *usedMonth, 
int *used)
 const 
 1628    const SectionNode &sn = 
sectionNode(sectionIndex);
 
 1630        qWarning(
"QDateTimeParser::findMonth Internal error");
 
 1637    monthNames.
reserve(13 - startMonth);
 
 1638    for (
int month = startMonth; month <= 12; ++month)
 
 1645int QDateTimeParser::findDay(
const QString &str1, 
int startDay, 
int sectionIndex, 
QString *usedDay, 
int *used)
 const 
 1647    const SectionNode &sn = 
sectionNode(sectionIndex);
 
 1649        qWarning(
"QDateTimeParser::findDay Internal error");
 
 1656    daysOfWeek.
reserve(8 - startDay);
 
 1657    for (
int day = startDay; day <= 7; ++day)
 
 1672QDateTimeParser::ParsedSection QDateTimeParser::findUtcOffset(
QStringView str, 
int mode)
 const 
 1677    if (startsWithUtc) {
 
 1679            return ParsedSection();
 
 1688        return ParsedSection();
 
 1693    bool hasColon = (colonPosition >= 0 && colonPosition < 3);
 
 1696    const int digits = hasColon ? colonPosition + 3 : 4;
 
 1702    const int hoursLength = 
qMin(
i, hasColon ? colonPosition : 2);
 
 1703    if (hoursLength < 1)
 
 1704        return ParsedSection();
 
 1708        if (!startsWithUtc && hoursLength != 2)
 
 1709            return ParsedSection();
 
 1713    if (
mode == (hasColon ? 2 : 3))
 
 1720        return ParsedSection();
 
 1722    const int minutes = minutesStr.
isEmpty() ? 0 : minutesStr.
toInt(&isInt);
 
 1724        return ParsedSection();
 
 1729    const State status = (hours > 14 || minutes >= 60) ? 
Invalid 
 1732    int offset = 3600 * hours + 60 * minutes;
 
 1737    const int usedSymbols = (startsWithUtc ? 3 : 0) + 1 + hoursLength + (hasColon ? 1 : 0)
 
 1738                            + minutesStr.
size();
 
 1740    return ParsedSection(status, 
offset, usedSymbols);
 
 1750QDateTimeParser::ParsedSection
 
 1754#if QT_CONFIG(timezone) 
 1757    const auto invalidZoneNameCharacter = [] (
const QChar &
c) {
 
 1758        const auto cu = 
c.unicode();
 
 1759        return cu >= 127u || !(memchr(
"+-./:_", 
char(cu), 6) || 
c.isLetterOrNumber());
 
 1770    while (lastSlash < 
index) {
 
 1771        int slash = 
str.
indexOf(u
'/', lastSlash + 1);
 
 1772        if (slash < 0 || slash > 
index)
 
 1774        else if (++
count > 5)
 
 1776        if (slash - lastSlash > 20)
 
 1777            index = lastSlash + 20; 
 
 1789    if (systemLength > 0)  
 
 1791    return ParsedSection();
 
 1806QDateTimeParser::ParsedSection
 
 1808                              int maxVal, 
int minVal, 
int mode)
 const 
 1815    ParsedSection section;
 
 1817        section = findUtcOffset(
str, 
mode);
 
 1818    if (
mode != 2 && 
mode != 3 && section.used <= 0)  
 
 1819        section = findTimeZoneName(
str, when);
 
 1821    if (section.state == 
Acceptable && (section.value < minVal || section.value > maxVal))
 
 1823    if (section.used > 0)
 
 1834    return ParsedSection();
 
 1851QDateTimeParser::AmPmFinder QDateTimeParser::findAmPm(
QString &
str, 
int sectionIndex, 
int *used)
 const 
 1855        qWarning(
"QDateTimeParser::findAmPm Internal error");
 
 1861        return PossibleBoth;
 
 1864    int size = sectionMaxSize(sectionIndex);
 
 1871    ampm[amindex] = getAmPmText(
AmText, Case(
s.count));
 
 1872    ampm[pmindex] = getAmPmText(
PmText, Case(
s.count));
 
 1873    for (
int i = 0; 
i < 2; ++
i)
 
 1874        ampm[
i].truncate(
size);
 
 1879        str = ampm[amindex];
 
 1882        str = ampm[pmindex];
 
 1889    bool broken[2] = {
false, 
false};
 
 1893            for (
int j=0; 
j<2; ++
j) {
 
 1897                              << 
"in" << ampm[
j] << 
"and got" << 
index;
 
 1900                            index = ampm[
j].indexOf(
ch.toLower());
 
 1902                                      << 
"in" << ampm[
j] << 
"and got" << 
index;
 
 1904                            index = ampm[
j].indexOf(
ch.toUpper());
 
 1906                                      << 
"in" << ampm[
j] << 
"and got" << 
index;
 
 1910                            if (broken[amindex] && broken[pmindex]) {
 
 1919                    ampm[
j].remove(
index, 1);
 
 1924    if (!broken[pmindex] && !broken[amindex])
 
 1925        return PossibleBoth;
 
 1926    return (!broken[amindex] ? PossibleAM : PossiblePM);
 
 1951        qWarning(
"QDateTimeParser::maxChange() Internal error (%ls)",
 
 2005        qWarning(
"QDateTimeParser::fieldInfo Internal error 2 (%d %ls %d)",
 
 2029        qWarning(
"QDateTimeParser::sectionFormat Internal error (%ls)",
 
 2034        qWarning(
"QDateTimeParser::sectionFormat Internal error 2");
 
 2059        val += year - (year % 100);
 
 2067    for (
int i=0; 
i<
len; ++
i) {
 
 2068        for (
int j=0; 
j<10; ++
j) {
 
 2071            } 
else if (
insert >= 0) {
 
 2095        Q_ASSERT(current >= minimum && current <= maximum);
 
 2114    return !potentialValue(
text, min, max, 
index, current, 
pos);
 
 2153    case Invalid: 
return "Invalid"_L1;
 
 2192        *datetime = tmp.
value;
 
 2204    return localTimeMin;
 
 2215    return localTimeMax;
 
 2218QString QDateTimeParser::getAmPmText(
AmPm ap, Case cs)
 const 
 2224    case UpperCase: 
return raw.
toUpper();
 
 2225    case LowerCase: 
return raw.
toLower();
 
 2226    case NativeCase: 
return raw;
 
 2228    Q_UNREACHABLE_RETURN(raw);
 
 2239    return (
s1.type == 
s2.type) && (
s1.pos == 
s2.pos) && (
s1.count == 
s2.count);
 
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
The QCalendar class describes calendar systems.
QDate dateFromParts(int year, int month, int day) const
int minimumDaysInMonth() const
Returns the number of days in the shortest month in the calendar, in any year.
bool isDateValid(int year, int month, int day) const
Returns true precisely if the given year, month, and day specify a valid date in this calendar.
QString monthName(const QLocale &locale, int month, int year=Unspecified, QLocale::FormatType format=QLocale::LongFormat) const
Returns a suitably localised name for a month.
YearMonthDay partsFromDate(QDate date) const
Converts a QDate to a year, month, and day of the month.
int maximumMonthsInYear() const
Returns the largest number of months that any year may contain.
int maximumDaysInMonth() const
Returns the number of days in the longest month in the calendar, in any year.
int dayOfWeek(QDate date) const
Returns the day of the week number for the given date.
int daysInMonth(int month, int year=Unspecified) const
Returns the number of days in the given month of the given year.
constexpr bool isDigit() const noexcept
Returns true if the character is a decimal digit (Number_DecimalDigit); otherwise returns false.
QChar toLower() const noexcept
Returns the lowercase equivalent if the character is uppercase or titlecase; otherwise returns the ch...
constexpr char toLatin1() const noexcept
Returns the Latin-1 character equivalent to the QChar, or 0.
constexpr bool isNull() const noexcept
Returns true if the character is the Unicode character 0x0000 ('\0'); otherwise returns false.
virtual QLocale locale() const
int absoluteMin(int index) const
virtual QString displayText() const
int sectionSize(int index) const
int absoluteMax(int index, const QDateTime &value=QDateTime()) const
QString stateName(State s) const
virtual ~QDateTimeParser()
FieldInfo fieldInfo(int index) const
virtual QDateTime getMaximum() const
bool fromString(const QString &text, QDate *date, QTime *time) const
int getDigit(const QDateTime &dt, int index) const
StateNode parse(const QString &input, int position, const QDateTime &defaultValue, bool fixup) const
void setCalendar(const QCalendar &calendar)
Sets cal as the calendar to use.
virtual int cursorPosition() const
virtual QDateTime getMinimum() const
bool skipToNextSection(int section, const QDateTime ¤t, QStringView sectionText) const
QList< SectionNode > sectionNodes
Section sectionType(int index) const
const SectionNode & sectionNode(int index) const
bool setDigit(QDateTime &t, int index, int newval) const
QMetaType::Type parserType
int sectionPos(int index) const
bool parseFormat(QStringView format)
\inmodule QtCore\reentrant
int offsetFromUtc() const
qint64 toMSecsSinceEpoch() const
static QDateTime fromMSecsSinceEpoch(qint64 msecs, const QTimeZone &timeZone)
QDateTime addMonths(int months) const
Returns a QDateTime object containing a datetime nmonths months later than the datetime of this objec...
QTime time() const
Returns the time part of the datetime.
QDateTime toLocalTime() const
Returns a copy of this datetime converted to local time.
QDateTime addSecs(qint64 secs) const
Returns a QDateTime object containing a datetime s seconds later than the datetime of this object (or...
Qt::TimeSpec timeSpec() const
Returns the time specification of the datetime.
bool isValid() const
Returns true if this datetime represents a definite moment, otherwise false.
qint64 daysTo(const QDateTime &) const
Returns the number of days from this datetime to the other datetime.
QTimeZone timeRepresentation() const
QDate date() const
Returns the date part of the datetime.
\inmodule QtCore \reentrant
constexpr bool isValid() const
Returns true if this date is valid; otherwise returns false.
constexpr qint64 toJulianDay() const
Converts the date to a Julian day.
int month() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
int day() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
int year() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
void getDate(int *year, int *month, int *day) const
int daysInMonth() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
QDateTime startOfDay(const QTimeZone &zone) const
qsizetype size() const noexcept
bool isEmpty() const noexcept
void append(parameter_type t)
uint toUInt(const QString &s, bool *ok=nullptr) const
Returns the unsigned int represented by the localized string s.
QString dayName(int, FormatType format=LongFormat) const
QString toString(qlonglong i) const
Returns a localized string representation of i.
bool startsWith(QStringView s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
constexpr void chop(qsizetype n) noexcept
Truncates this string view by length characters.
constexpr bool isEmpty() const noexcept
Returns whether this string view is empty - that is, whether {size() == 0}.
constexpr qsizetype size() const noexcept
Returns the size of this string view, in UTF-16 code units (that is, surrogate pairs count as two for...
constexpr QStringView first(qsizetype n) const noexcept
constexpr QStringView left(qsizetype n) const noexcept
QByteArray toLatin1() const
Returns a Latin-1 representation of the string as a QByteArray.
QString toString() const
Returns a deep copy of this string view's data as a QString.
int toInt(bool *ok=nullptr, int base=10) const
Returns the string view converted to an int using base base, which is 10 by default and must be betwe...
constexpr QChar at(qsizetype n) const noexcept
Returns the character at position n in this string view.
constexpr QStringView sliced(qsizetype pos) const noexcept
\macro QT_RESTRICTED_CAST_FROM_ASCII
QByteArray toLatin1() const &
int toInt(bool *ok=nullptr, int base=10) const
Returns the string converted to an int using base base, which is 10 by default and must be between 2 ...
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
QString & replace(qsizetype i, qsizetype len, QChar after)
void truncate(qsizetype pos)
Truncates the string at the given position index.
const QChar * constData() const
Returns a pointer to the data stored in the QString.
const_iterator cbegin() const
qsizetype size() const
Returns the number of characters in this string.
const_iterator cend() const
QString arg(qlonglong a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const
QString mid(qsizetype position, qsizetype n=-1) const
Returns a string that contains n characters of this string, starting at the specified position index.
QString first(qsizetype n) const
const QChar at(qsizetype i) const
Returns the character at the given index position in the string.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QString & insert(qsizetype i, QChar c)
QString toLower() const &
qsizetype count(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString sliced(qsizetype pos) const
QString left(qsizetype n) const
Returns a substring that contains the n leftmost characters of the string.
static QString static QString qsizetype indexOf(QChar c, qsizetype from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
QString toUpper() const &
static constexpr int MaxUtcOffsetSecs
bool isValid() const
Returns true if this time zone is valid.
static QTimeZone fromSecondsAheadOfUtc(int offset)
static constexpr int MinUtcOffsetSecs
\inmodule QtCore \reentrant
int hour() const
Returns the hour part (0 to 23) of the time.
int minute() const
Returns the minute part (0 to 59) of the time.
bool isValid() const
Returns true if the time is valid; otherwise returns false.
int msecsTo(QTime t) const
Returns the number of milliseconds from this time to t.
int msec() const
Returns the millisecond part (0 to 999) of the time.
int second() const
Returns the second part (0 to 59) of the time.
constexpr size_type size() const noexcept
const T & at(qsizetype idx) const
void reserve(qsizetype sz)
cache insert(employee->id(), employee)
QSet< QString >::iterator it
struct wl_display * display
Combined button and popup list for selecting options.
constexpr const T & min(const T &a, const T &b)
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION QByteArrayView trimmed(QByteArrayView s) noexcept
static jboolean copy(JNIEnv *, jobject)
static int dayOfWeekDiff(int sought, int held)
static void appendSeparator(QStringList *list, QStringView string, int from, int size, int lastQuote)
static int countRepeat(QStringView str, int index, int maxCount)
static int weekDayWithinMonth(QCalendar calendar, int year, int month, int day, int weekDay)
static QString unquote(QStringView str)
static bool preferDayOfWeek(const QList< QDateTimeParser::SectionNode > &nodes)
static int startsWithLocalTimeZone(QStringView name)
static QDate actualDate(QDateTimeParser::Sections known, const QCalendar &calendar, int year, int year2digits, int month, int day, int dayofweek)
static qsizetype digitCount(QStringView str)
static QTime actualTime(QDateTimeParser::Sections known, int hour, int hour12, int ampm, int minute, int second, int msec)
static int findTextEntry(const QString &text, const ShortVector< QString > &entries, QString *usedText, int *used)
#define QDATETIMEEDIT_DATE_MIN
#define QDATETIMEEDIT_DATE_MAX
Q_CORE_EXPORT bool operator==(const QDateTimeParser::SectionNode &s1, const QDateTimeParser::SectionNode &s2)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
qsizetype qt_repeatCount(QStringView s)
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qBound(const T &min, const T &val, const T &max)
constexpr const T & qMax(const T &a, const T &b)
GLsizei const GLfloat * v
[13]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat s1
GLenum GLenum GLsizei count
GLenum GLuint GLintptr offset
GLint GLsizei GLsizei GLenum format
GLenum GLenum GLenum input
static void add(QPainterPath &path, const QWingedEdge &list, int edge, QPathEdge::Traversal traversal)
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
#define Q_ASSERT_X(cond, x, msg)
QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIterator begin(const QRegularExpressionMatchIterator &iterator)
static constexpr QChar sep
#define qUtf16Printable(string)
QString qTzName(int dstIndex)
static double WeekDay(double t)
static QString quote(const QString &str)
QFileInfo fi("c:/temp/foo")
[newstuff]
static QString name(Section s)
\inmodule QtCore \reentrant