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

Function format_date64

cpp/gdb_arrow.py:282–295  ·  view source on GitHub ↗

Format a date64 value.

(val)

Source from the content-addressed store, hash-verified

280
281
282def 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
298def format_timestamp(val, unit):

Callers 1

to_stringMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected