"The Datetime API provides a number of methods for manipulating Python datetime objects and converting them to and from other formats like timestamps or string representations."
Datetime.ParseDate(date)
Attempts to convert the given string into a datetime object.
Return type: datetime
for myMedia in myMedias:
addedAt = myMedia.get('addedAt')
test = Datetime.ParseDate(addedAt).date
print test.strftime('%m/%d/%Y')
Output from debug log:
File "/root/Library/Plex Media Server/Plug-ins/Plex2csv.bundle/Contents/Code/__init__.py", line 437, in scanMovieDBBasic
test = Datetime.ParseDate(addedAt).date
File "/share/MD0_DATA/.qpkg/PlexMediaServer/Library/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/utilkit.py", line 376, in ParseDate
result = dateutil.parser.parse(date)
File "/root/Library/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/dateutil/parser.py", line 700, in parse
return DEFAULTPARSER.parse(timestr, **kwargs)
File "/root/Library/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/dateutil/parser.py", line 309, in parse
ret = default.replace(**repl)
ValueError: year is out of range
Which leads me to a "simple" Q:
What's behind the number?
I guessed it was either Unix TmeStamp or millisec. since Barkley's birth?
Problem is though, that I don't know how old Barkley is :D
<Video ratingKey="3" key="/library/metadata/3" studio="Warner Bros. Entertainment" type="movie" title="Charlie and the Chocolate Factory" originalTitle="Charlie and the Chocolate Factory" contentRating="PG" summary="En ung dreng vinder en turné gennem den mest fantastiske chokolade fabrik i verden, ledet af verdens mest usædvanlige slik fabrikant" rating="5.8000001907348597" year="2005" tagline="Veruca Is a very bad nut" thumb="/library/metadata/3/thumb/1393433793" art="/library/metadata/3/art/1393433793" duration="6896977" originallyAvailableAt="2005-07-10" addedAt="1393433761" updatedAt="1393433793">