weeks_diff

description

Syntax

INT weeks_diff(DATETIME enddate, DATETIME startdate)

开始时间到结束时间相差几星期

example

  1. mysql> select weeks_diff('2020-12-25','2020-10-25');
  2. +----------------------------------------------------------+
  3. | weeks_diff('2020-12-25 00:00:00', '2020-10-25 00:00:00') |
  4. +----------------------------------------------------------+
  5. | 8 |
  6. +----------------------------------------------------------+

keywords

  1. weeks_diff