MCPcopy Index your code
hub / github.com/plotly/plotly.py / encode_as_date

Method encode_as_date

_plotly_utils/utils.py:312–319  ·  view source on GitHub ↗

Attempt to convert to utc-iso time string using date methods.

(obj)

Source from the content-addressed store, hash-verified

310
311 @staticmethod
312 def encode_as_date(obj):
313 """Attempt to convert to utc-iso time string using date methods."""
314 try:
315 time_string = obj.isoformat()
316 except AttributeError:
317 raise NotEncodable
318 else:
319 return iso_to_plotly_time_string(time_string)
320
321 @staticmethod
322 def encode_as_decimal(obj):

Callers 1

test_encode_as_dateMethod · 0.80

Calls 1

Tested by 1

test_encode_as_dateMethod · 0.64