Format a date32 value.
(val)
| 265 | |
| 266 | |
| 267 | def format_date32(val): |
| 268 | """ |
| 269 | Format a date32 value. |
| 270 | """ |
| 271 | val = int(val) |
| 272 | try: |
| 273 | decoded = datetime.date.fromordinal(val + _date_base) |
| 274 | except ValueError: # "ordinal must be >= 1" |
| 275 | return f"{val}d [year <= 0]" |
| 276 | else: |
| 277 | return f"{val}d [{decoded}]" |
| 278 | |
| 279 | |
| 280 | def format_date64(val): |