class_docstr: Stores and handles locale-specific information related to time.
  
  ATTRIBUTES:
      f_weekday -- full weekday names (7-item list)
      a_weekday -- abbreviated weekday names (7-item list)
      f_month -- full month names (13-item list; dummy value in [0], which
                  is added by code)
      a_month -- abbreviated month names (13-item list, dummy value in
                  [0], which is added by code)
      am_pm -- AM/PM representation (2-item list)
      LC_date_time -- format string for date/time representation (string)
      LC_date -- format string for date representation (string)
      LC_time -- format string for time representation (string)
      timezone -- daylight- and non-daylight-savings timezone representation
                  (2-item list of sets)
      lang -- Language used by instance (2-item tuple)
class_docstr_tok: ["Stores","and","handles","locale-specific","information","related","to","time",".","ATTRIBUTES",":","f_weekday","--","full","weekday","names","(","7-item","list",")","a_weekday","--","abbreviated","weekday","names","(","7-item","list",")","f_month","--","full","month","names","(","13-item","list",";","dummy","value","in","[","0","]",",","which","is","added","by","code",")","a_month","--","abbreviated","month","names","(","13-item","list",",","dummy","value","in","[","0","]",",","which","is","added","by","code",")","am_pm","--","AM\/PM","representation","(","2-item","list",")","LC_date_time","--","format","string","for","date\/time","representation","(","string",")","LC_date","--","format","string","for","date","representation","(","string",")","LC_time","--","format","string","for","time","representation","(","string",")","timezone","--","daylight-","and","non-daylight-savings","timezone","representation","(","2-item","list","of","sets",")","lang","--","Language","used","by","instance","(","2-item","tuple",")"]
code: def __calc_date_time(self):
      # Set self.date_time, self.date, & self.time by using
      # time.strftime().
  
      # Use (1999,3,17,22,44,55,2,76,0) for magic date because the amount of
      # overloaded numbers is minimized.  The order in which searches for
      # values within the format string is very important; it eliminates
      # possible ambiguity for what something represents.
      time_tuple = time.struct_time((1999, 3, 17, 22, 44, 55, 2, 76, 0))
      date_time = [None, None, None]
      date_time[0] = time.strftime("%c", time_tuple).lower()
      date_time[1] = time.strftime("%x", time_tuple).lower()
      date_time[2] = time.strftime("%X", time_tuple).lower()
      replacement_pairs = [
          ("%", "%%"),
          (self.f_weekday[2], "%A"),
          (self.f_month[3], "%B"),
          (self.a_weekday[2], "%a"),
          (self.a_month[3], "%b"),
          (self.am_pm[1], "%p"),
          ("1999", "%Y"),
          ("99", "%y"),
          ("22", "%H"),
          ("44", "%M"),
          ("55", "%S"),
          ("76", "%j"),
          ("17", "%d"),
          ("03", "%m"),
          ("3", "%m"),
          # '3' needed for when no leading zero.
          ("2", "%w"),
          ("10", "%I"),
      ]
      replacement_pairs.extend(
          [
              (tz, "%Z")
              for tz_values in self.timezone
              for tz in tz_values
          ]
      )
      for offset, directive in ((0, "%c"), (1, "%x"), (2, "%X")):
          current_format = date_time[offset]
          for old, new in replacement_pairs:
              # Must deal with possible lack of locale info
              # manifesting itself as the empty string (e.g., Swedish's
              # lack of AM/PM info) or a platform returning a tuple of empty
              # strings (e.g., MacOS 9 having timezone as ('','')).
              if old:
                  current_format = current_format.replace(old, new)
          # If %W is used, then Sunday, 2005-01-03 will fall on week 0 since
          # 2005-01-03 occurs before the first Monday of the year.  Otherwise
          # %U is used.
          time_tuple = time.struct_time((1999, 1, 3, 1, 1, 1, 6, 3, 0))
          if "00" in time.strftime(directive, time_tuple):
              U_W = "%W"
          else:
              U_W = "%U"
          date_time[offset] = current_format.replace("11", U_W)
      self.LC_date_time = date_time[0]
      self.LC_date = date_time[1]
      self.LC_time = date_time[2]
  
imports: import time
  import locale
  import calendar
  from re import compile
  from re import IGNORECASE
  from re import escape
  from datetime import date, timedelta, timezone
  from _thread import allocate_lock
label_desc: Use image node_id 5 for calling the LocaleTime obj's underlying member method code with example usage: obj.__calc_date_time() without return types