Powered by Tachyonic Project Luxon Framework v0.0.0

Luxon Framework for rapid application development. (luxon)

Version

Timezones

HTTP Date Converter

luxon.utils.timezone.parse_http_date(http_date, obs_date=False)[source]

Converts an HTTP date string to a datetime instance.

Parameters:
  • http_date (str) – An RFC 1123 date string. e.g. Tue, 15 Nov 1994 12:45:26 GMT
  • obs_date (bool) – Support obs-date formats according to RFC 7231. (Default False) e.g. Sunday, 06-Nov-94 08:49:37 GMT
Returns:

A UTC datetime instance corresponding to the given HTTP date.

Return type:

datetime

Raises:

ValueError – http_date doesn’t match any of the available time formats

GMT Timezone

class luxon.utils.timezone.TimezoneGMT[source]

GMT timezone class implementing GMT Timezone

dst(dt)[source]

Return the daylight saving time (DST) adjustment.

GMT has no daylight savings time. Always Zero.

Parameters:dt (datetime.datetime) – Ignored
Returns:DST adjustment for GMT.
Return type:datetime.timedelta
tzname(dt)[source]

Get the name of this timezone.

Parameters:dt (datetime.datetime) – Ignored
Returns:e.g. “GMT”
Return type:str
utcoffset(dt)[source]

Get the offset from UTC.

Parameters:dt (datetime.datetime) – Ignored
Returns:Offset.
Return type:datetime.timedelta

UTC Timezone

class luxon.utils.timezone.TimezoneUTC[source]

UTC timezone class implementing UTC Timezone