.oO SearXNG Developer Documentation Oo.
|
Public Member Functions | |
__init__ (self, datetime.datetime time) | |
__str__ (self) | |
str | l10n (self, DateTimeFormats|str fmt="medium", DateTimeLocaleTypes|babel.Locale|GeoLocation|None locale=None) |
str | l10n_date (self, DateTimeFormats|str fmt="medium", DateTimeLocaleTypes|babel.Locale|GeoLocation|None locale=None) |
Public Attributes | |
datetime = time |
Class to represent date & time. Essentially, it is a wrapper that conveniently combines :py:obj:`datetime.datetime` and :py:obj:`babel.dates.format_datetime`. A conversion of time zones is not provided (in the current version). The localized string representation can be obtained via the :py:obj:`DateTime.l10n` and :py:obj:`DateTime.l10n_date` methods, where the ``locale`` parameter defaults to the search language. Alternatively, a :py:obj:`GeoLocation` or a :py:obj:`babel.Locale` instance can be passed directly. If the UI language is to be used, the string ``UI`` can be passed as the value for the ``locale``.
Definition at line 205 of file weather.py.
searx.weather.DateTime.__init__ | ( | self, | |
datetime.datetime | time ) |
Definition at line 219 of file weather.py.
searx.weather.DateTime.__str__ | ( | self | ) |
Definition at line 222 of file weather.py.
References l10n().
str searx.weather.DateTime.l10n | ( | self, | |
DateTimeFormats | str | fmt = "medium", | ||
DateTimeLocaleTypes | babel.Locale | GeoLocation | None | locale = None ) |
Localized representation of date & time.
Definition at line 225 of file weather.py.
References searx.weather._get_sxng_locale_tag(), searx.result_types.answer.WeatherAnswer.Item.datetime, and datetime.
Referenced by searx.weather.Compass.__str__(), __str__(), searx.weather.Pressure.__str__(), searx.weather.RelativeHumidity.__str__(), searx.weather.Temperature.__str__(), and searx.weather.WindSpeed.__str__().
str searx.weather.DateTime.l10n_date | ( | self, | |
DateTimeFormats | str | fmt = "medium", | ||
DateTimeLocaleTypes | babel.Locale | GeoLocation | None | locale = None ) |
Localized representation of date.
Definition at line 239 of file weather.py.
References searx.weather._get_sxng_locale_tag(), searx.result_types.answer.WeatherAnswer.Item.datetime, and datetime.
searx.weather.DateTime.datetime = time |
Definition at line 220 of file weather.py.
Referenced by l10n(), and l10n_date().