MCPcopy Create free account
hub / github.com/apache/arrow / format_date64

Function format_date64

cpp/gdb_arrow.py:280–293  ·  view source on GitHub ↗

Format a date64 value.

(val)

Source from the content-addressed store, hash-verified

278
279
280def 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
296def format_timestamp(val, unit):

Callers 1

to_stringMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected