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