Obsolete Members for QDate

Los siguientes miembros de la clase QDate son obsoletos. Se proporcionan para que el código fuente antiguo siga funcionando. Desaconsejamos su uso en código nuevo.

Funciones públicas

(deprecated in 6.9) QDateTime endOfDay(Qt::TimeSpec spec, int offsetSeconds = 0) const
(deprecated in 6.9) QDateTime startOfDay(Qt::TimeSpec spec, int offsetSeconds = 0) const

Documentación de funciones miembro

[deprecated in 6.9] QDateTime QDate::endOfDay(Qt::TimeSpec spec, int offsetSeconds = 0) const

Esta función está obsoleta desde la versión 6.9. Desaconsejamos su uso en código nuevo.

Utilice endOfDay(const QTimeZone &) instead. Returns the end-moment of the day. When a day ends depends on a how time is described: each day starts and ends earlier for those with higher offsets from UTC and later for those with lower offsets from UTC. The time representation to use can be specified either by a \a spec and \a offsetSeconds (ignored unless \a spec is Qt::OffsetSeconds) or by a time zone. Usually, the end of the day is one millisecond before the midnight, 24:00: however, if a local time transition causes the given date to skip over that moment (e.g. a DST spring-forward skipping over 23:00 and the following hour), the actual latest time in the day is returned. When \a spec is Qt::OffsetFromUTC, \a offsetSeconds gives the implied zone's offset from UTC. As UTC and such zones have no transitions, the end of the day is QTime(23, 59, 59, 999) in these cases. In the rare case of a date that was entirely skipped (this happens when a zone east of the international date-line switches to being west of it), the return shall be invalid. Passing Qt::TimeZone as \a spec (instead of passing a QTimeZone) will also produce an invalid result, as shall dates that end outside the range representable by QDateTime.

Esta función sobrecarga QDate::endOfDay().

[deprecated in 6.9] QDateTime QDate::startOfDay(Qt::TimeSpec spec, int offsetSeconds = 0) const

Esta función está obsoleta desde la versión 6.9. Desaconsejamos su uso en código nuevo.

Utilice startOfDay(const QTimeZone &) en su lugar.

Devuelve el momento de inicio del día.

El momento en que comienza un día depende de cómo se describa el tiempo: cada día comienza y termina antes para aquellos con mayor desfase respecto a UTC y más tarde para aquellos con menor desfase respecto a UTC. La representación del tiempo a utilizar puede especificarse mediante spec y offsetSeconds (se ignora a menos que spec sea Qt::OffsetSeconds) o mediante una zona horaria.

Normalmente, el comienzo del día es a medianoche, 00:00: sin embargo, si una transición horaria local hace que la fecha dada se salte esa medianoche (por ejemplo, un adelanto de DST saltándose la primera hora del día), se devuelve la hora real más temprana del día.

Cuando spec es Qt::OffsetFromUTC, offsetSeconds da un desfase de zona implícito con respecto a UTC. Como UTC y esas zonas no tienen transiciones, el inicio del día es QTime(0, 0) en estos casos.

En el raro caso de una fecha que se haya saltado por completo (esto ocurre cuando una zona al este de la línea internacional de fecha pasa a estar al oeste de la misma), el retorno será inválido. Pasar Qt::TimeZone como spec (en lugar de pasar QTimeZone) también producirá un resultado inválido, al igual que las fechas que comiencen fuera del rango representable por QDateTime.

Esta función sobrecarga QDate::startOfDay().

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.