start_of_week
NAME
start_of_week(): Returns first day of week of given DATETIME (i.e. start of Monday), as DATE objectTYPE
FunctionDESCRIPTION
Returns midnight, starting Monday in same week as given DATETIME.
SYNOPSIS
start_of_week(dt DATETIME) RETURNS DATE
Input:
- dt: a DATETIME object, from which to extract same week's Monday.
EXAMPLES
mysql> SELECT common_schema.start_of_week('2011-03-24 11:17:08') as dt; +------------+ | dt | +------------+ | 2011-03-21 | +------------+