|
bool | IsNull () const |
| Returns TRUE if the date is null; otherwise returns FALSE. A null date is invalid.
.
|
|
bool | IsValid () const |
| Returns TRUE if this date is valid; otherwise returns FALSE. .
|
|
bool | IsValid (int y, int m, int d) |
| Returns TRUE if the specified date (year y, month m and day d) is valid; otherwise returns FALSE. .
|
|
int | Year () const |
| Returns the year (1752..8000) of this date. .
|
|
int | Month () const |
| Returns the month (January=1..December=12) of this date. .
|
|
int | Day () const |
| Returns the day of the month (1..31) of this date. .
|
|
int | DayOfWeek () const |
| Returns the weekday (Monday=1..Sunday=7) for this date. .
|
|
int | DayOfYear () const |
| Returns the day of the year (1..365) for this date. .
|
|
int | DaysInMonth () const |
| Returns the number of days in the month (28..31) for this date. .
|
|
int | DaysInYear () const |
| Returns the number of days in the year (365 or 366) for this date. .
|
|
int | WeekNumber () const |
| Returns the week number (1 to 53) for this date.
|
|
QString | ToString (const QString &format=QString::null) const |
| Возвращает дату в виде строки.
|
|
QDate | ToDate () const |
| Возвращает представление даты в объекте сласса QDate. .
|
|
bool | SetYMD (int y, int m, int d) |
| Sets the date's year y, month m and day d.
|
|
aDateService * | AddDays (int ndays) const |
| Returns a aDateService object containing a date ndays later than the date of this object (or earlier if ndays is negative). .
|
|
aDateService * | AddMonths (int nmonths) const |
| Returns a aDateService object containing a date nmonths later than the date of this object (or earlier if nmonths is negative). .
|
|
aDateService * | AddYears (int nyears) const |
| Возвращает объект класса aDateService содержащий дату на nyears лет позднее хранимой в объекте даты (или ранее, если nyears меньше нуля). .
|
|
int | DaysTo (const aDateService &target) const |
| Возвращает количество дней до указанной даты от даты, представленной объектом.
|
|
int | DaysTo (const QDate &target) const |
| Возвращает количество дней до указанной даты от даты, представленной объектом.
|
|
Сервисный класс для операций с датами.
По сути, предоставляет доступ из Ананас-Скрипта к методам объекта QDate. Предоставляет удобные методы для определения количества дней между двумя любыми датами, вычисления даты прибавлением количества дней к исходной дате.
int aDateService::DaysTo |
( |
const aDateService & | target | ) |
const |
|
slot |
Возвращает количество дней до указанной даты от даты, представленной объектом.
Возвращаемое значение может быть отрицательным, если указанная дата находится в прошлом по отношению к дате, представленной объектом.
Перекрестные ссылки Day(), Month() и Year().
int aDateService::DaysTo |
( |
const QDate & | target | ) |
const |
|
slot |
Возвращает количество дней до указанной даты от даты, представленной объектом.
Возвращаемое значение может быть отрицательным, если указанная дата находится в прошлом по отношению к дате, представленной объектом.
Перекрестные ссылки Day(), Month() и Year().
bool aDateService::SetYMD |
( |
int | y, |
|
|
int | m, |
|
|
int | d ) |
|
slot |
Sets the date's year y, month m and day d.
y must be in the range 1752..8000, m must be in the range 1..12, and d must be in the range 1..31. Warning: If y is in the range 0..99, it is interpreted as 1900..1999.
- Возвращает
- TRUE if the date is valid; otherwise returns FALSE.
QString aDateService::ToString |
( |
const QString & | format = QString::null | ) |
const |
|
slot |
Возвращает дату в виде строки.
Формат даты задается параметром. Если параметр не задан, дата возвращается в формате dd.MM.yyyy
Для задания формата даты могут быть использованы следующие наборы символов: d - the day as number without a leading zero (1-31) dd - the day as number with a leading zero (01-31) ddd - the abbreviated localized day name (e.g. 'Mon'..'Sun'). dddd - the long localized day name (e.g. 'Monday'..'Sunday'). M - the month as number without a leading zero (1-12) MM - the month as number with a leading zero (01-12) MMM - the abbreviated localized month name (e.g. 'Jan'..'Dec'). MMMM - the long localized month name (e.g. 'January'..'December'). yy - the year as two digit number (00-99). yyyy - the year as four digit number (1752-8000)
Example format strings (assuming that the Date is the 20th July 1969):
Format dd.MM.yyyy Result 20.07.1969 Format ddd MMMM d yy Result Sun July 20 69