KDECore
klocalizeddate.h
Go to the documentation of this file.
321 bool setDate(KLocale::WeekNumberSystem weekNumberSystem, int year, int weekOfYear, int dayOfWeek);
KCalendarSystem abstract base class, provides support for local Calendar Systems in KDE.
Definition kcalendarsystem.h:41
A class representing a date localized using the local calendar system, language and formats.
Definition klocalizeddate.h:139
static KLocalizedDate currentDate()
Returns a KLocalizedDate set to today's date in the Global Locale and Calendar System.
Definition klocalizeddate.cpp:222
int day() const
Returns the day portion of the date in the current calendar system.
Definition klocalizeddate.cpp:268
bool operator>=(const KLocalizedDate &other) const
KLocalizedDate greater than or equal to operator.
Definition klocalizeddate.cpp:580
KLocalizedDate addMonths(int months) const
Returns a KLocalizedDate containing a date months months later.
Definition klocalizeddate.cpp:428
static KLocalizedDate readDate(const QString &dateString, KLocale::DateTimeParseMode parseMode=KLocale::LiberalParsing, const KCalendarSystem *calendar=0)
Converts a localized date string to a KLocalizedDate using either the Global Calendar System and Loca...
Definition klocalizeddate.cpp:372
void setCalendarSystem(KLocale::CalendarSystem calendarSystem)
Set the Calendar System used for this date instance only.
Definition klocalizeddate.cpp:131
int week(int *yearNum=0) const
Returns the localized Week Number for the date.
Definition klocalizeddate.cpp:298
int yearsDifference(const KLocalizedDate &toDate) const
Returns the difference between this and another date in completed calendar years in the current Calen...
Definition klocalizeddate.cpp:466
KLocalizedDate lastDayOfMonth() const
Returns a KLocalizedDate containing the last day of the currently set month.
Definition klocalizeddate.cpp:517
QString eraName() const
Returns the Era Name portion of the date in the current calendar system, for example "AD" or "Anno Do...
Definition klocalizeddate.cpp:273
KLocalizedDate firstDayOfYear() const
Returns a KLocalizedDate containing the first day of the currently set year.
Definition klocalizeddate.cpp:496
int yearInEra() const
Returns the Year In Era portion of the date in the current calendar system, for example 1 for "1 BC".
Definition klocalizeddate.cpp:283
QString formatDate(KLocale::DateFormat dateFormat=KLocale::LongDate) const
Returns the Date as a localized string in the requested standard Locale format.
Definition klocalizeddate.cpp:349
int weeksInYear() const
Returns the number of localized weeks in the currently set year.
Definition klocalizeddate.cpp:313
int month() const
Returns the month portion of the date in the current calendar system.
Definition klocalizeddate.cpp:263
KLocalizedDate & operator=(const KLocalizedDate &rhs)
Assignment operator.
Definition klocalizeddate.cpp:109
KLocalizedDate lastDayOfYear() const
Returns a KLocalizedDate containing the last day of the currently set year.
Definition klocalizeddate.cpp:503
static KLocalizedDate fromJulianDay(int jd)
Returns a KLocalizedDate set the required Julian Day number in the Global Locale and Calendar System.
Definition klocalizeddate.cpp:232
bool operator>(const KLocalizedDate &other) const
KLocalizedDate greater than operator.
Definition klocalizeddate.cpp:570
KLocalizedDate addDays(int days) const
Returns a KLocalizedDate containing a date days days later.
Definition klocalizeddate.cpp:441
const KCalendarSystem * calendar() const
Returns a pointer to the Calendar System object used by this date instance.
Definition klocalizeddate.cpp:149
KLocalizedDate(const QDate &date=QDate(), const KCalendarSystem *calendar=0)
Constructs a localized date with the given date.
Definition klocalizeddate.cpp:93
int toJulianDay() const
Returns the currently set date as a Julian Day number.
Definition klocalizeddate.cpp:243
void dateDifference(const KLocalizedDate &toDate, int *yearsDiff, int *monthsDiff, int *daysDiff, int *direction) const
Returns the difference between this and another date in years, months and days in the current Calenda...
Definition klocalizeddate.cpp:454
KLocalizedDate firstDayOfMonth() const
Returns a KLocalizedDate containing the first day of the currently set month.
Definition klocalizeddate.cpp:510
bool isLeapYear() const
Returns whether the currently set date falls in a Leap Year in the current Calendar System.
Definition klocalizeddate.cpp:338
KLocalizedDate addYears(int years) const
Returns a KLocalizedDate containing a date years years later.
Definition klocalizeddate.cpp:414
bool isValid() const
Returns whether the date is valid in the current Calendar System.
Definition klocalizeddate.cpp:168
int year() const
Returns the year portion of the date in the current calendar system.
Definition klocalizeddate.cpp:258
int monthsDifference(const KLocalizedDate &toDate) const
Returns the difference between this and another date in completed calendar months in the current Cale...
Definition klocalizeddate.cpp:476
bool operator<=(const KLocalizedDate &other) const
KLocalizedDate less than or equal to operator.
Definition klocalizeddate.cpp:560
static KLocalizedDate fromDate(const QDate &date)
Returns a KLocalizedDate set the required date in the Global Locale and Calendar System.
Definition klocalizeddate.cpp:227
QString eraYear() const
Returns the Era Year portion of the date in the current calendar system, for example "2000 AD" or "He...
Definition klocalizeddate.cpp:278
int daysDifference(const KLocalizedDate &toDate) const
Returns the difference between this and another date in days The returned value will be negative if t...
Definition klocalizeddate.cpp:486
void getDate(int *year, int *month, int *day) const
Returns the year, month and day portion of the date in the current Calendar System.
Definition klocalizeddate.cpp:253
KLocale::CalendarSystem calendarSystem()
Returns the Calendar System used by this localized date instance.
Definition klocalizeddate.cpp:144
bool operator<(const KEntryKey &k1, const KEntryKey &k2)
Compares two KEntryKeys (needed for QMap).
Definition kconfigdata.h:124
QDataStream & operator>>(QDataStream &s, KDateTime::Spec &spec)
Read a KDateTime::Spec object into spec from in, in binary format.
Definition kdatetime.cpp:274
QDataStream & operator>>(QDataStream &in, KLocalizedDate &date)
Data stream input operator.
Definition klocalizeddate.cpp:595
QDataStream & operator<<(QDataStream &out, const KLocalizedDate &date)
Data stream output operator.
Definition klocalizeddate.cpp:590
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 17 2025 00:00:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 17 2025 00:00:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.