Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions |
The QTimeString class provides localized strings for times and dates. More...
#include <QTimeString>
The QTimeString class provides localized strings for times and dates.
It is recommended to use QTimeString rather than QDateTime::toString() because QTimeString returns localized strings for a given date and/or time. Each function expects a parameter that determines the length of a returned string. If the user changes the date or time format all strings obtained from QTimeString have to be invalidated. The QtopiaApplication::dateFormatChanged() and QtopiaApplication::clockChanged() signals will indicate when this happens. The handler for these signals must ensure that all time/date strings are refreshed.
Warning: The length of the localized string can vary among languages.
See also QtopiaApplication::dateFormatChanged() and QtopiaApplication::clockChanged().
This enum specifies the different string lengths supported by QTimeString.
Constant | Value | Description |
---|---|---|
QTimeString::Short | 0 | Returns shortest possible string (mostly used on phones). |
QTimeString::Medium | 1 | Returns default length string. |
QTimeString::Long | 2 | Returns verbose string. |
Returns true if 12 hour time is preferred over 24 hour time; otherwise returns false.
Returns the date format used by QTimeString (e.g. D.M.Y) if set; otherwise returns an empty string.
In case no format is set the default format which is returned by QLocale::dateFormat() in QLocale::ShortFormat is used.
See also QTimeString::formatOptions().
Returns additional format options for a date string. The default format is the format of the current locale as returned by QLocale::dateFormat() in QLocale::ShortFormat.
See also QTimeString::currentFormat().
Returns a localized name of the week day on date in the given len.
Returns a localized string for hour, in 12 hour if QTimeString::currentAMPM() is true; otherwise in 24 hour format.
If hour is greater than 23 or less then 0 then hour will default to 0.
Returns a localized string for t in the given len, showing hours and minutes.
The format, including order depends on the user's settings.
Returns a localized string for t in the given len, showing hours, minutes, and day of the week.
The format, including order depends on the user's settings.
Returns a localized string for t in the given len, showing hours, minutes, and seconds.
The format, including order depends on the user's settings.
Returns a localized string for t in the given len, showing hours, minutes, seconds, and day of the week.
The format, including order depends on the user's settings.
Returns a localized string for dt in the given len, showing month and date.
The format, including the order of month and date depends on the user's current locale.
Returns a localized string for dt in the given len showing year, month, and date.
The format, including order depends on the user's settings.
Returns a localized string for dt in the given len, showing year, month, date, hours, minutes, and seconds.
The format, including order depends on the user's settings.
Returns the name of month in the given len.
Returns the name for the day of the week in the given len.
Returns a localized string for date showing day, month and year as a number in the given len.
The format, including order depends on the user's settings.
Copyright © 2009 Trolltech | Trademarks | Qt Extended 4.4.3 |