MCPcopy
hub / github.com/borgbackup/borg / OutputTimestamp

Class OutputTimestamp

src/borg/helpers/time.py:179–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177
178
179class OutputTimestamp:
180 def __init__(self, ts: datetime):
181 self.ts = ts
182
183 def __format__(self, format_spec):
184 # we want to output a timestamp in the user's local timezone
185 return format_time(self.ts.astimezone(), format_spec=format_spec)
186
187 def __str__(self):
188 return self.isoformat()
189
190 def isoformat(self):
191 # we want to output a timestamp in the user's local timezone
192 return self.ts.astimezone().isoformat(timespec="microseconds")
193
194 to_json = isoformat
195
196
197def archive_ts_now():

Callers 5

infoMethod · 0.85
__str__Method · 0.85
format_timeMethod · 0.85
format_timeMethod · 0.85
basic_json_dataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected