I am looking for a method how to effectively request data from sql server assuming that request goes from different timezones.
for example request from Australia (UTC/GMT +11 hours) will ask for records older than 2005-11-19 18:00:00
but server in Canada (UTC/GMT -5 hours) and all records saved as a Canadian.
canadian user through UI will pick '2005-11-19 18:00:00' date and we will do this seelct to sql server
select * from table1 where added < '2005-11-19 18:00:00'
same select from Australian user assuming that user picked same date through UI has to be
select * from table1 where added < '2005-11-19 02:00:00'
my question is what is the right way to query sql server from different timezones and get results assuming time zones.
answers like Effectively Converting dates between UTC and Local (ie. PST) time in SQL 2005 do not work because I would like to do it declaratively through the connection and do not want to put any logic in sql.