pyams_utils.timezone
package ⊞¶
PyAMS_utils.timezone package
All datetime values should be stored in UTC to avoid any problem. Then values can be displayed to users using a specific timezone; by default, used timezone is the one specified into server settings via an IServerTimezone utility which is created automatically when initializing a new site.
There is no easy way to get user’s timezone from it’s browser settings; so the more common choice is to let users define their timezone in their profile’s settings.
-
pyams_utils.timezone.
gmtime
(value)[source]¶ Convert datetime to GMT
Value is assumed to be in GMT if no timezone is given
-
pyams_utils.timezone.
localgmtime
(value)[source]¶ Convert datetime to GMT
Value is assumed to be in server timezone if none is given
-
pyams_utils.timezone.
tzinfo
(request=None)[source]¶ request to timezone adapter
There is no easy way to get timezone from a request. This adapter assumes that the timezone is given by a registered utility…
-
pyams_utils.timezone.
tztime
(value)[source]¶ Convert datetime to local timezone
Parameters: value (datetime) – input datetime; value is assumed to be in GMT if no timezone is given
pyams_utils.timezone.utility
¶
PyAMS_utils.timezone.utility module