Okay here is what I am trying to do:
$timezone1 = '+00:00';
$timezone2 = '+08:00';
WHERE DATE(CONVERT_TZ(from_unixtime(comment_date), '$timezone1', '$timezone2')) = DATE_SUB(CURRENT_DATE,INTERVAL 1 DAY)";
That line gives me the total count of yesterdays submissions in a table, by transforming the output into my correct timezone.
Now I want to do the same with the total count of this weeks submissions:
WHERE YEARWEEK(from_unixtime(comment_date), 1) = YEARWEEK(CURRENT_DATE, 1)";
that gives me the total count of submissions for this week, yet with the wrong time offset. How do I get $timezone1 and $timezone2 into this line? I tried several combinations, but nothing seems to work, such as:
WHERE (CONVERT_TZ(YEARWEEK(from_unixtime(comment_date), 1), '$timezone1', '$timezone2')) = YEARWEEK(CURRENT_DATE, 1)";