I'm working on JBake, and would like to get the year part of the date at which a document was stored.
I know I can get the date by doing
SELECT date FROM post
And OrientDB will return me a java.util.Date.
I know I can also add the year as another field, but I find this data duplication unsatistfying.
So, is it possible to store the date, and to to have the year extracted through some kind of SQL "function" ?
Typically I would love to do
SELECT date, {date.getYear()} FROM post
You could use the format() function using the SimpleDateFormat syntax:
select date.format('YYYY') from post