Change time based on client timezone
Posted on 2011-02-14
I am querying a datetime field from SQL database to show the date and time of an event. The person who sets the event date and time is in one particualar timezone (Mountain Time USA), but users may be in a different time who see the event date and time. Is there a way to have the time adjusted based on the location of the user in a different timezone? For example, if someone in California views the same info, it will subtract one hour so the time they view will coordinate with the user who sets the time?
Currently, I just have something like: "Select right(convert(varchar(19), EventStart, 100),6) As Time from Event Where something = @something"
That gives me the time from the datetime sql field. but need to adjust it depending on where someone might be in multiple different timezones.