Load a timezone name from a DLL offset (integer). >>> from dateutil.tzwin import tzres >>> tzr = tzres() >>> print(tzr.load_name(112)) 'Eastern Standard Time' :param offset: A positive integer value referring to a string from the tzres d
(self, offset)
| 69 | self.tzres_loc = tzres_loc |
| 70 | |
| 71 | def load_name(self, offset): |
| 72 | """ |
| 73 | Load a timezone name from a DLL offset (integer). |
| 74 | |
| 75 | >>> from dateutil.tzwin import tzres |
| 76 | >>> tzr = tzres() |
| 77 | >>> print(tzr.load_name(112)) |
| 78 | 'Eastern Standard Time' |
| 79 | |
| 80 | :param offset: |
| 81 | A positive integer value referring to a string from the tzres dll. |
| 82 | |
| 83 | .. note:: |
| 84 | |
| 85 | Offsets found in the registry are generally of the form |
| 86 | ``@tzres.dll,-114``. The offset in this case is 114, not -114. |
| 87 | |
| 88 | """ |
| 89 | resource = self.p_wchar() |
| 90 | lpBuffer = ctypes.cast(ctypes.byref(resource), wintypes.LPWSTR) |
| 91 | nchar = self.LoadStringW(self._tzres._handle, offset, lpBuffer, 0) |
| 92 | return resource[:nchar] |
| 93 | |
| 94 | def name_from_string(self, tzname_str): |
| 95 | """ |
no outgoing calls