Hello All,
I need to terminate an user as per their timezone. From HR we are getting user's Termination date and time. For example: 11/05/2018 05:00PM.
Case 1:
1. If user is in East Coast time zone, user need to be terminated at 5PM EST
Case 2:
1. If user is in Central Time Zone, user need to be terminated at 6PM EST
Case 3:
1. If user is other country like (Europe, India etc..), user need to be terminated their 5PM time.
My database is configured to UTC time. When I check user's data in Object Browser it shows: 11/5/2018 5:00PM, Value shows 11/5/2018 10:00PM (Because of UTC time). I have user's location data (contains country and State), depending upon, i need to calculate users timezone and terminate user. I tried different queries, but unable to resolve the issue for all time zone users. Here are the query I used:
UID_Person in (
select p.UID_Person
from Person p
left join DialogState c on c.UID_DialogState = p.UID_DialogState
where p.EntryDate is not null
and GetUTCDate() >= DateAdd(second, isnull(-(c.AVGUTCOffset), 0), p.Exitdate)
and isinactive = 0
)
Any idea how to apply the logic?
Thanks In advance,
Jaipal.