In the JCR, I've noticed that dates are stored in the format Feb 19, 2015 12:00:00 AM. This means that when you try and order a query by a date, it doesn't seem to work:
SELECT * FROM [mgnl:pages] ORDER BY articlePublishedDate
Will return:
Apr 1, 2015 12:00:00 AMDec 1, 2015 12:00:00 AMFeb 1, 2015 12:00:00 AM
Is there any way to make the ORDER BY clause act as a integer? I've tried CAST(articlePublishedDate AS LONG) but it appears my content repository doesn't like it ...