Package osaf :: Package pim :: Package calendar :: Module TimeZone
[hide private]
[frames] | no frames]

Module TimeZone

source code

Classes [hide private]
  DateAndNoDateFormats
  TZPrefs
  TimeZoneInfo
Item that persists:
Functions [hide private]
 
_setTimeZoneInSubformats(msgFormat, tz) source code
 
coerceTimeZone(view, dt, tzinfo)
This method returns a datetime with a specified tzinfo.
source code
 
convertFloatingEvents(view, newTZ)
Convert existing floating events to the default timezone.
source code
 
convertToICUtzinfo(view, dt)
This method returns a datetime whose tzinfo field (if any) is an instance of the ICUtzinfo class.
source code
 
equivalentTZIDs(tzinfo) source code
 
forceToDateTime(view, dt, tzinfo=<Locale: en_US>)
If dt is a datetime, return dt, if a date, add time(0) and return.
source code
 
formatTime(view, dt, tzinfo=<Locale: en_US>, noTZ=True, includeDate=True) source code
 
getTimeZoneCode(view, dt) source code
 
installParcel(parcel, oldVersion=<Locale: en_US>) source code
 
ontzchange(view, tzinfo) source code
 
reindexFloatingEvents(view, tzinfo)
When the user's default timezone changes, datetime values with a floating timezone may compare differently with non-floating datetimes than before.
source code
 
serializeTimeZone(tzinfo)
Given a tzinfo class, return a VTIMEZONE in an iCalendar object.
source code
 
shortTZ(view, dt, tzinfo=<Locale: en_US>)
Return an empty string or the short timezone string for dt if dt.tzinfo doesn't match tzinfo (tzinfo defaults to PyICU.ICUtzinfo.default)
source code
 
stripTimeZone(view, dt)
This method returns a naive datetime (i.e.
source code
Variables [hide private]
  FormatDictParent = {False: {}, True: {}}
  dateutil_utc = tzutc()
  tzid_mapping = {}
Function Details [hide private]

coerceTimeZone(view, dt, tzinfo)

source code 

This method returns a datetime with a specified tzinfo.

If the target tzinfo is None, this returns stripTimeZone(dt). Otherwise, if dt is naive, it's interpreted as being in the user's default timezone.
Parameters:
  • dt (datetime) - The input.
  • tzinfo (tzinfo) - The target tzinfo (may be None)
Returns:
A datetime whose tzinfo field is the same as the target.

convertFloatingEvents(view, newTZ)

source code 

Convert existing floating events to the default timezone.

Don't convert events that are in shared collections, because they may be someone else's events and are intended to be floating.

convertToICUtzinfo(view, dt)

source code 
This method returns a datetime whose tzinfo field (if any) is an instance of the ICUtzinfo class.
Parameters:
  • dt (datetime) - The datetime whose tzinfo field we want to convert to an ICUtzinfo instance.

forceToDateTime(view, dt, tzinfo=<Locale: en_US>)

source code 
If dt is a datetime, return dt, if a date, add time(0) and return.
Parameters:
  • dt (datetime or date) - The input.
Returns:
A datetime

reindexFloatingEvents(view, tzinfo)

source code 
When the user's default timezone changes, datetime values with a floating timezone may compare differently with non-floating datetimes than before. So, we need to resort some indexes if they did comparison of floating datetimes. At the moment, the only way we let floating datetimes creep into indexes is via EventStamp.startTime, EventStamp.recurrenceEnd and ContentItem.displayDate (the latter being computed in some cases from the first).

stripTimeZone(view, dt)

source code 
This method returns a naive datetime (i.e. one with a tzinfo of None.
Parameters:
  • dt (datetime) - The input.
Returns:
If the input is naive, just returns dt. Otherwise, converts the input into the user's default timezone, and then strips that out.