Format a date64 value.
(val)
| 280 | |
| 281 | |
| 282 | def format_date64(val): |
| 283 | """ |
| 284 | Format a date64 value. |
| 285 | """ |
| 286 | val = int(val) |
| 287 | days, remainder = divmod(val, 86400 * 1000) |
| 288 | if remainder: |
| 289 | return f"{val}ms [non-multiple of 86400000]" |
| 290 | try: |
| 291 | decoded = datetime.date.fromordinal(days + _date_base) |
| 292 | except ValueError: # "ordinal must be >= 1" |
| 293 | return f"{val}ms [year <= 0]" |
| 294 | else: |
| 295 | return f"{val}ms [{decoded}]" |
| 296 | |
| 297 | |
| 298 | def format_timestamp(val, unit): |