Messagelib
dateformatter.h
Go to the documentation of this file.
105 [[nodiscard]] QString dateString(const QDateTime &dtime, const QString &lang = QString(), bool shortFormat = true) const;
145 [[nodiscard]] static QString formatDate(DateFormatter::FormatType ftype, const QDateTime &t, const QString &data = QString(), bool shortFormat = true);
159 [[nodiscard]] static QString formatCurrentDate(DateFormatter::FormatType ftype, const QString &data = QString(), bool shortFormat = true);
void invalidateReferenceDate() const
Invalidates the cached reference date used by the Fancy formatter to determine the meaning of "Today"...
Definition dateformatter.cpp:143
static QString formatCurrentDate(DateFormatter::FormatType ftype, const QString &data=QString(), bool shortFormat=true)
Convenience function, same as formatDate() but returns the current time formatted.
Definition dateformatter.cpp:221
void setCustomFormat(const QString &format)
Sets the custom format for date to string conversions to format.
Definition dateformatter.cpp:132
static QString formatDate(DateFormatter::FormatType ftype, const QDateTime &t, const QString &data=QString(), bool shortFormat=true)
Convenience function dateString.
Definition dateformatter.cpp:212
QString dateString(const QDateTime &dtime, const QString &lang=QString(), bool shortFormat=true) const
Constructs a formatted date string from QDateTime dtime.
Definition dateformatter.cpp:98
DateFormatter(FormatType ftype=DateFormatter::Fancy)
Constructs a date formatter with a default FormatType.
Definition dateformatter.cpp:80
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 31 2025 12:05:41 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 31 2025 12:05:41 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.