MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _datetime_to_pdf

Function _datetime_to_pdf

lib/matplotlib/backends/backend_pdf.py:203–224  ·  view source on GitHub ↗

Convert a datetime to a PDF string representing it. Used for PDF and PGF.

(d)

Source from the content-addressed store, hash-verified

201
202
203def _datetime_to_pdf(d):
204 """
205 Convert a datetime to a PDF string representing it.
206
207 Used for PDF and PGF.
208 """
209 r = d.strftime('D:%Y%m%d%H%M%S')
210 z = d.utcoffset()
211 if z is not None:
212 z = z.seconds
213 else:
214 if time.daylight:
215 z = time.altzone
216 else:
217 z = time.timezone
218 if z == 0:
219 r += 'Z'
220 elif z < 0:
221 r += "+%02d'%02d'" % ((-z) // 3600, (-z) % 3600)
222 else:
223 r += "-%02d'%02d'" % (z // 3600, z % 3600)
224 return r
225
226
227def _calculate_quad_point_coordinates(x, y, width, height, angle=0):

Callers 2

_metadata_to_strFunction · 0.90
pdfReprFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…