I'm stuck in this logic. I'm working on a message scheduling project and I have clients from different countries. Let's consider Asia (does not observe daylight saving) and America/New York (observes daylight saving).
Now, i'm writing following query to get schedules within 10 min gap from current time:
select message,subject,person_or_group,customer_id from common_schedule where reminder_type_1 in('beforedays','beforehours') and now() between cast(reminder_time1 as datetime) and addtime(cast(reminder_time1 as datetime),'00:10:00')
Now, if we have two records, one for New York (under daylight saving) and one for New Delhi: India that is not under daylight saving, I'll get wrong data for New York as 1 hour should be subtracted from it.
Also assume that there is an extra column in the table DY (daylight saving) which has values 'y' or 'n'.