diff --git a/src/DateTime/DateTime.py b/src/DateTime/DateTime.py index 4cd43b7..9f57c09 100644 --- a/src/DateTime/DateTime.py +++ b/src/DateTime/DateTime.py @@ -310,6 +310,21 @@ def _tzoffset2iso8601zone(seconds): return "%+03d:%02d" % divmod((seconds / 60), 60) +class strftimeFormatter: + + def __init__(self, dt, format): + self._dt=dt + self._f=format + + def __call__(self): + return self._dt.strftime(self._f) + + +def Timezones(): + """Return the list of recognized timezone names""" + return sorted(list(PytzCache._zmap.values())) + + class DateTime(object): """DateTime objects represent instants in time and provide interfaces for controlling its representation without @@ -1847,19 +1862,3 @@ def encode(self, out): out.write('') out.write(self.ISO8601()) out.write('\n') - - -class strftimeFormatter: - - def __init__(self, dt, format): - self._dt=dt - self._f=format - - def __call__(self): - return self._dt.strftime(self._f) - - -# Module methods -def Timezones(): - """Return the list of recognized timezone names""" - return sorted(list(PytzCache._zmap.values()))