Hi, If I understand you correctly the this query should help you:
select date_format(date_add(DateTime, interval 7 hour), "%Y%m%d") as Date, count(1) from Table1 group by Date order by Date Best regards, Mikhail. ----- Original Message ----- From: "Graeme B. Davis" <[EMAIL PROTECTED]> To: "Graeme B. Davis" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, October 14, 2003 2:36 PM Subject: Time zones and grouping > Does anyone know any way to be able to group by day/week/month for an > adjusted date (GMT -> EDT). > > I store dates as GMT in the db, but sometimes I want to count the > number of rows per EDT day instead of GMT day. I can't figure out how > to do this. > > Ideas? > > Thanks, > > Graeme > > > ----- Original Message ----- > From: "Graeme B. Davis" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Friday, October 10, 2003 2:12 PM > Subject: Converting GMT stored data into other zones > > > | I was wondering if anyone had any tricks on the best way to handle > | localizing time zones in MySql? > | > | For example, all my datetime data is stored as GMT. I have written > | tools to query the data based upon whatever local time zone you want > | to use. So, for example if I query for 2003-10-1 to 2003-10-2 in > EDT, > | it would really query 2003-9-30 20:00:00 to 2003-10-1 20:00:00. > | > | BUT, I've run into a problem when you want to GROUP BY > | DAYOFYEAR(datefield) for example, I want it to do the grouping by > EDT > | and not GMT -- is this possible? > | > | Regards, > | > | Graeme > | > | > | -- > | MySQL General Mailing List > | For list archives: http://lists.mysql.com/mysql > | To unsubscribe: > http://lists.mysql.com/[EMAIL PROTECTED] > | > | > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]