{
detach();
d->date = date;
- if (d->spec == QDateTimePrivate::LocalStandard)
+ if (d->spec == QDateTimePrivate::LocalStandard
+ || d->spec == QDateTimePrivate::LocalDST)
d->spec = QDateTimePrivate::LocalUnknown;
if (date.isValid() && !d->time.isValid())
d->time = QTime(0, 0, 0);
void QDateTime::setTime(const QTime &time)
{
detach();
- if (d->spec == QDateTimePrivate::LocalStandard)
+ if (d->spec == QDateTimePrivate::LocalStandard
+ || d->spec == QDateTimePrivate::LocalDST)
d->spec = QDateTimePrivate::LocalUnknown;
d->time = time;
}
dt.d->time.mds = msecsFromDecomposed(t->tm_hour, t->tm_min, t->tm_sec, tv.tv_usec / 1000);
dt.d->date.jd = julianDayFromDate(t->tm_year + 1900, t->tm_mon + 1, t->tm_mday);
- dt.d->spec = (t->tm_isdst >= 0 ? QDateTimePrivate::LocalStandard :
- QDateTimePrivate::LocalUnknown);
+ dt.d->spec = t->tm_isdst > 0 ? QDateTimePrivate::LocalDST :
+ t->tm_isdst == 0 ? QDateTimePrivate::LocalStandard :
+ QDateTimePrivate::LocalUnknown;
return dt;
}
date = QDate(brokenDown->tm_year + 1900, brokenDown->tm_mon + 1, brokenDown->tm_mday);
time = QTime(brokenDown->tm_hour, brokenDown->tm_min, brokenDown->tm_sec, time.msec());
date = date.addDays(deltaDays);
- if (brokenDown->tm_isdst < 0)
+ if (brokenDown->tm_isdst > 0)
+ return QDateTimePrivate::LocalDST;
+ else if (brokenDown->tm_isdst < 0)
return QDateTimePrivate::LocalUnknown;
else
return QDateTimePrivate::LocalStandard;
class QDateTimePrivate
{
public:
- enum Spec { LocalUnknown = -1, LocalStandard = 0, UTC = 1, OffsetFromUTC = 2 };
+ enum Spec { LocalUnknown = -1, LocalStandard = 0, LocalDST = 1, UTC = 2, OffsetFromUTC = 3};
QDateTimePrivate() : spec(LocalUnknown), utcOffset(0) {}
QDateTimePrivate(const QDateTimePrivate &other)