February 7, 2011 at 2:45 am
Hello All
Is there any function which I can use for converting local date time to Israel standard time?
Regards,
February 7, 2011 at 3:03 am
you can refer to this post
http://www.mssqltips.com/tip.asp?tip=1145
and can select the required date formate as per your requirement
----------
Ashish
February 7, 2011 at 3:20 am
I think you dint get my point....
I m talking about "how to convert local date time to Israel standard time".
I m not concerned on how to format the date time
Regard,
February 7, 2011 at 3:41 am
There are 2 option :-
1) You can configure your server/localmachine(whever you running query) to Israel date time format.
OR
2) I am assuming if your server is configured with UTC then you can use
select dateadd(min,120,getdate())
-- which means add 120 min or 2 hr from current time of GMT to make it Israel time
----------
Ashish
February 7, 2011 at 3:42 am
What does local time mean ? Wouldn't "local" refer to elsewhere ? whats your local ? Calculate the time difference between your local zone and Isreal Standard Time and use DATEADD function.
February 7, 2011 at 5:17 am
You can check the GMT time (with GETUTCDATE() function) and then add 2 hours to it (to get the local time at Israel). The problem is that this calculation is correct when there is no daylight saving in Israel, but when Israel uses daylight saving, you’ll need to add 3 hours.
Adi
--------------------------------------------------------------
To know how to ask questions and increase the chances of getting asnwers:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply