GREL Date Functions - tfmorris/OpenRefine GitHub Wiki
Date functions supported by the OpenRefine Expression Language (GREL)
See also: All GREL functions.
Returns the current time.
Returns o converted to a date object.
All other arguments are optional:
- month_first: set false if the date is formatted with the day before the month.
- formatN: attempt to parse the date using an ordered list of possible formats. See SimpleDateFormat for the syntax.
Examples: You can parse the cells "Nov-09" and "11/09" using
value.toDate('MM/yy','MMM-yy').toString('yyyy-MM')For a date of the form: "1/4/2012 13:30:00" use GREL function:
toDate(value,"dd/mm/YYYY H:m:s")
When o is a date, format specifies how to format the date.
For dates, returns the difference in given time units.
See https://github.com/OpenRefine/OpenRefine/issues/624 for a discussion on a bug in dif() and its workaround.
Returns a date changed by the given amount in the given unit of time. Unit defaults to 'hour'.
Returns part of a date.