DateFunction
class DateFunction
This class provides some date functions for the expression parser.
Methods
static DateTime
nthDayOfMonth(int $nth, int $day, int $month, int $year)
Returns the date corresponding of the nth day of a month
static int
lastDay(int $month, int $year)
Returns the last day of the month
static DateTime
firstDayOfMonth(DateTime $dateObj)
Returns a new date corresponding to the first day of the month of the given date.
static DateTime
lastDayOfMonth(DateTime $dateObj)
Returns a new date corresponding to the last day of the month of the given date.
Details
at line 52
static DateTime
nthDayOfMonth(int $nth, int $day, int $month, int $year)
Returns the date corresponding of the nth day of a month
Ex: nthDayOfMonth(1, 0, 1, 2017) for the question: what is the first sunday of January 2017
at line 71
static int
lastDay(int $month, int $year)
Returns the last day of the month
Ex: lastDay(2, 2017) returns 28.
at line 86
static DateTime
firstDayOfMonth(DateTime $dateObj)
Returns a new date corresponding to the first day of the month of the given date.