MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _format_offset

Function _format_offset

tools/python-3.11.9-amd64/Lib/datetime.py:182–198  ·  view source on GitHub ↗
(off)

Source from the content-addressed store, hash-verified

180 return fmt.format(hh, mm, ss, us)
181
182def _format_offset(off):
183 s = ''
184 if off is not None:
185 if off.days < 0:
186 sign = "-"
187 off = -off
188 else:
189 sign = "+"
190 hh, mm = divmod(off, timedelta(hours=1))
191 mm, ss = divmod(mm, timedelta(minutes=1))
192 s += "%s%02d:%02d" % (sign, hh, mm)
193 if ss or ss.microseconds:
194 s += ":%02d" % ss.seconds
195
196 if ss.microseconds:
197 s += '.%06d' % ss.microseconds
198 return s
199
200# Correctly substitute for %z and %Z escapes in strftime formats.
201def _wrap_strftime(object, format, timetuple):

Callers 2

_tzstrMethod · 0.85
isoformatMethod · 0.85

Calls 1

timedeltaClass · 0.85

Tested by

no test coverage detected