开发者

sql server 2008 timeing related

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 开发者_Python百科server 2008


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜