Skip to content

Instantly share code, notes, and snippets.

@fabioricali
Created October 26, 2020 14:51
Show Gist options
  • Save fabioricali/6ac88308a6f294fff33ef97891650842 to your computer and use it in GitHub Desktop.
Save fabioricali/6ac88308a6f294fff33ef97891650842 to your computer and use it in GitHub Desktop.
MYSQL: get quarter of hour from a date
SELECT SEC_TO_TIME((TIME_TO_SEC(NOW()) DIV 900) * 900) AS QUARTER_HOUR;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment