﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
28410	query filter on date portion of datetime creates wrong parameters for mysql CONVERT_TZ function and returns no results	donaldinho	nobody	"I am setting the timezone

{{{
tz = timezone.get_fixed_timezone(-300)
timezone.activate(tz)
}}}

then I apply the filter. search_date is just a string submitted by the client

{{{
matches = query.filter(startDateTime__date=datetime.strptime(search_date, '%Y-%m-%d').date())
}}}

the where clause that is produced is 
{{{
DATE(CONVERT_TZ(`match`.`startDateTime`, 'UTC', '-0500')) = '2017-07-18'
}}}

where as it should be

{{{
DATE(CONVERT_TZ(match`.`startDateTime`, 'UTC', '-05:00')) = '2017-07-18'
}}}

note the colon in the timezone we are converting to. "	Bug	new	Database layer (models, ORM)	1.11	Normal		timezone date filter		Unreviewed	0	0	0	0	0	0
