Need mySQL TIMESTAMP for begining of the current week or any given date?

Posted by Kenan on Stack Overflow See other posts from Stack Overflow or by Kenan
Published on 2010-05-25T17:09:02Z Indexed on 2010/05/25 17:11 UTC
Read the original article Hit count: 233

Filed under:
|
|

Hi,

I need mySQL timestamp for start of current week or any given date, if week starts with monday?

I'm trying something like:

SELECT UNIX_TIMESTAMP(CONCAT( DATE_SUB(CURDATE(), INTERVAL WEEKDAY(DATE_SUB(CURDATE(), INTERVAL 7 DAY)) DAY), ' 00:00:00')) as start

© Stack Overflow or respective owner

Related posts about mysql

Related posts about mysql-query