I am building a web page which pulls videos from both YouTube and Vimeo, creates thumbnails for them, and should then sort the thumbnails by date. I currently am querying the vVimeo album API endpoint and the YouTube data API - which both return dates for videos in a slightly different manner.
YouTube DATE: 2012-12-20T08:00:40.000Z
VIMEO DATE: 2013-01-02 13:33:51
My question is, how do I get these two different formats into a singular format that I can then sort with JavaScript / jQuery? I'm assuming if I manage to strip the dashes, spaces, and colons, remove the "t" and "z" in the YouTube date, I'll have an actual number which could be sorted - but it seems a little janky, and I'm hoping there is a better way to format these. Anyone have any ideas?