The Date Time module includes a group of operations to manage dates and times.
Operation | Description | Demo |
DATEOBJ(x,y) | Get the date object from an string representation of date. DATEOBJ( date_string, format ) |
DATEOBJ('2013-05-21', 'yyyy-mm-dd') |
YEAR(x,y) | Get the year from an string representation of date. YEAR( date_string, format ) |
YEAR('2013-05-21', 'yyyy-mm-dd') |
MONTH(x,y) | Get the month from an string representation of date. MONTH( date_string, format ) |
MONTH('2013-05-21', 'yyyy-mm-dd') |
DAY(x,y) | Get the days from an string representation of date. DAY( date_string, format ) |
DAY('2013-05-21', 'yyyy-mm-dd') |
WEEKDAY(x,y) | Get the week day from an string representation of date. WEEKDAY( date_string, format ) |
WEEKDAY('2013-10-27', 'yyyy-mm-dd') |
WEEKNUM(x,y) | Get the week number from an string representation of date, a year has 53 weeks.WEEKNUM( date_string, format ) |
WEEKNUM('2013-10-27', 'yyyy-mm-dd') |
HOURS(x,y) | Get hours from an string representation of datetime. HOURS( datetime_string, format ) |
HOURS('2013-10-27 01:21', 'yyyy-mm-dd hh:ii') |
MINUTES(x,y) | Get minutes from an string representation of datetime. MINUTES( datetime_string, format ) |
MINUTES('2013-10-27 01:22', 'yyyy-mm-dd hh:ii') |
SECONDS(x,y) | Get seconds from an string representation of datetime. SECONDS( datetime_string, format ) |
SECONDS('2013-10-27 01:22:56', 'yyyy-mm-dd hh:ii:ss') |
NOW() | Get a date object with the current day-time information. NOW() |
NOW() |
TODAY() | Get a date object with the current day information, without the time part.TODAY() |
|
DATEDIFF(date_one, date_two, date_format, return) | Get the difference between two dates strings representation DATEDIFF(date_one, date_two, date_format, return) The function return an object, whose value depends of argument 'return' Possible values of return argument: |
DATEDIFF('2013-10-27', '2012-06-22', 'yyyy-mm-dd', 'y')['months'] |
DATETIMESUM(date_string, format, number, to_increase) | Increases the date-time string representation in the number of seconds, minutes, hours, days, months, or years, passed as parameter. DATETIMESUM( date_string, format, number, to_increase ) |
DATETIMESUM('2013-10-27', 'yyyy-mm-dd', 5, 'd') Result: The date object representation of 2013/11/01 |
GETDATETIMESTRING(datetime_object, format) | Returns the string representation of a date object GETDATETIMESTRING( datetime_object, format ) |
GETDATETIMESTRING(TODAY(), 'yyyy-mm-dd') |