| 177 | |
| 178 | |
| 179 | class 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 | |
| 197 | def archive_ts_now(): |
no outgoing calls
no test coverage detected