views:

20

answers:

1

I want to find out what will be the time in India when clock tick to 1Am mid night in any other country.. How i will find out that through any means plz help me to find out this this is to fire birthbay mails at 1AM midnight of that resp country... so i did following

DECLARE @indianTime DATETIME --= SYSDATETIMEOFFSET() 
DECLARE @timeZoneOffset NVARCHAR(6) = '+01:00' 
SELECT SWITCHOFFSET(SYSDATETIMEOFFSET() , @timeZoneOffset) 

this is giving me current time of that country but i want wat will be indian time when there is mdnight 1Am time of that country... Iam using sql server 2008

A: 

Your code does what it should (at least, it does in my SQL 2008).

What you need is some way to trigger your query in real-time (probably something running hourly as a job), or some helper tables.

Adding more detail to your problem, other code you already have, etc., will help us help you.

Tobiasopdenbrouw
This is obviously related to http://stackoverflow.com/questions/3360266/to-compare-indian-time, but is it also related to http://stackoverflow.com/questions/3332238/get-current-date-everyday-for-a-windows-service?I do not mean to offend, but perhaps some basic coursework on .net and sql may help. Or is this homework?
Tobiasopdenbrouw