get ALL columns within the current week, converted from UTC to timezoneX

Viewed 23

I try to form a query to return all columns but it's not working

SELECT * from mycalendar WHERE WEEK(datetime)=week(now());`

This returns everything however the date/time is stored in UTC in the database, so it will miss anything that could be in the same week but in UTC it's already the next week.

The following will return all the correct values adjusted for timezone, but I need all columns, instead I get both of the same columns.

SELECT CONVERT_TZ(datetime, '+00:00', '-05:00') AS localdatetime,
(select localdatetime WHERE WEEK(localdatetime)=week(now())) FROM mycalendar;
0 Answers
Related