SQL Server 2005 and conversion of date-time between time-zones

Hi.

I am using SQL Server 2005 and have some SQL Jobs which run as scheduled. There is a date-time field in one of my tables which take time-zone specific values. Now I need either of the following:

  • Convert that date-time to equivalent GMT or UTC date-time (with DST awareness). GETUTCDATE() converts local date-time [GETDATE()] to its GMT equivalent, but I have the requirement to change a particular date-time value to GMT.  
  • Convert one date-time value from one time-zone to another time-zone date-time value.

Any help for this is appreciated.. Thanks in advance..

0
nidhi
9/22/2008 5:12:09 AM
asp.net.sql-datasource 29906 articles. 0 followers. Follow

1 Replies
819 Views

Similar Articles

[PageSpeed] 34

see this link.

 http://msdn.microsoft.com/en-us/library/system.datetime.tolocaltime.aspx


Give a man a fish and you feed him for a day. Teach a man to fish and you feed him forever.
0
ramireddyindia
9/22/2008 7:34:25 AM
Reply:

Similar Artilces:

date time in sql server 2005
hi all, in my sql server 2005 , i 've a table gg containing a column 'date'.its data type is datetime ,null now i want to insert only the date to this field from vb.net page. i dont want "time" to insert in this page. one more thing ,i know varchar will work for what i need but i want to use date time. If anyone who knows how this is possible pls do send me the code.  thanks swapnaThanks SwapnaPlease click "mark as answer" if this post helped you. I don't think you should worry about inserting the time part of the value.  If you only wa...

Calculating time between two date in Sql Server 2005
Calculating time between two date In Sql Server 2005help me .. Mitesh Darji SELECT DATEDIFF(hh, GETDATE(), @YOUR_DATE)   where hh defines that we want to get a hours. dd means days, mi - minutes etc.May the Force be with you use datediff function with the help of CAST.Plz check thses linkshttp://msdn2.microsoft.com/en-us/library/aa258269(SQL.80).aspxhttp://msdn2.microsoft.com/en-us/library/ms187928.aspxhttp://technet.microsoft.com/en-us/library/aa237920(SQL.80).aspx Thank uBabaPlease remember to click "Mark as Answer" on this post if it helped you. &nbs...

SQL Server Reporting Services for SQL SERVER 2000 AND Visual Studio.NET 2005 .NET 2.0
Hi, Which version of SQl Server Reporting Services will work with SQL SERVER 2000 in pararrel with ASP.NET 2.0 (.NET 2.0 framework)?  Thanks, Azam HighOnCodingWanna get high! Hi, Okay I got the answer. Yes, we can use the SQL SERVER 2005 Reporting Services with SQL SERVER 2000. HighOnCodingWanna get high! ...

sql server 2005 add current time to the passed date
 Greetings,I have an e-timesheet application.i made a function that takes the startdate of the week:public SqlDataReader GetProjectsActive(DateTime SheetDate)         {            SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["connectionString"]);            SqlCommand myCommand = new SqlCommand("GetProjectsActive", myConnection);            myCommand.CommandType = Comma...

Date Times into MS-SQL server database using .Net
I keep getting errors when trying to input a date time string into an MS SQL Server database and i'm begining to loose patience with it. My field is set up as "datetime" field with a length of 8 (bits ?) My sql string to input into that database is tehn concatonated like so (using sql and vb.net).... mystring = "UPDATE tablename SET mydatefield='" & DateTime.Now & "' WHERE id=" & frmid I keep getting the following error.... The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. The statem...

time in sql server is not the real time
Hi,when i create a new user in a .MDF file, the hour of creation in the field "createdate" of table "membership" is exactly 2 hours less than the time of my computer. Probably something to do with different hours between Europe and UK or ...How can i set the creation hour to exact the same hour of my computer?ThanksTartuffe If I'm not mistaken, it is setting the date using Coordinated Universal Time (UTC). From Wikipedia:Time zones around the world are expressed as positive or negative offsets from UTC. As the zero-point reference, UTC is also referred to as Zulu time (Z). UTC is often r...

Converting MDF files (SQL Server Express) to SQL Server 2005 WITHOUT having to buy SQL Server 2005 (I have Express). Personal WebSite Starter Kit
Hi (and HELP!),   I downloaded the Personal WebSite Starter Kit and got it working no problem on my local machine.  But I've had nothing but frustration trying to get it up and running on a webhosting site.  I picked hostmysite.com which uses SQL Server 2005.  I was under the impression that it wouldn't be that big a deal to convert the .MDF files that Sql Server Express uses to a SQL Server 2005 database.  I tried using SQL Server Management Studio Express.  I was able to "see" my remote database on hostmysite.com, but I was not able to import the .mdf files ...

Converting MDF files (SQL Server Express) to SQL Server 2005 WITHOUT having to buy SQL Server 2005 (I have Express). Personal WebSite Starter Kit
Hi,Basically i built a webpage with Login and it's working well from my local machine.Right now, i'm using Database Publishing Wizard. the problem is how do i convert.MDF files to .SQL 2005 to get my database publish in the internet? thanks  Place your .MDF file in the App_Data directory, change the connection string accordingly and then publish your web site. ----------------------------------------------------------Please click Mark As Answer if this helped in solving your problem.  Please click "Mark As Answer" if this hepled in solving your problem. ...

Converting MDF files (SQL Server Express) to SQL Server 2005 WITHOUT having to buy SQL Server 2005 (I have Express). Personal WebSite Starter Kit
Hi (and HELP!),   I downloaded the Personal WebSite Starter Kit and got it working no problem on my local machine.  But I've had nothing but frustration trying to get it up and running on a webhosting site.  I picked hostmysite.com which uses SQL Server 2005.  I was under the impression that it wouldn't be that big a deal to convert the .MDF files that Sql Server Express uses to a SQL Server 2005 database.  I tried using SQL Server Management Studio Express.  I was able to "see" my remote database on hostmysite.com, but I was not able to import the .mdf file...

SQL server 2005 and SQL server 2005 lite
Hi, I have a web site hosted at a hosting company.. I'm in the process of designing a web site which has some forms that are going to hit a database, etc.. for a small company.. This small company has it's own Web server, and when I'm finished I'll copy the finsihed product to their IIS web server, etc.. Well, I have SQL server 2005 full edition as part of my web hosting, but I'm going to have to use SQL server Lite for the end user / client since they don't have SQL server. So, I'm wondering if I can do my work on MY remote host using the full edition of SQL server 2005, and then copy to th...

SQL Server 2005 Installation problems with SQL Server Express & SQL Server 2000
Hi Guys, I have had SQL Server Express and Sql Server Management Studio Express installed on my machine for some time and recently tried to install a trial of SQL Server 2005 as well.  (Yes, I'm migrating from Visual Studio Express to Visual Studio Professional, just as in tended!) Everything went fine except that nothing seemed to be installed.  I searched in all the obvious places - both on the Start/Programs menu and on the hard-drive: nothing. A check under Add/Remove Programs showed that Sql Server 2005 Express was installed, but called SQL Server 2005. So after a number o...

Time Conversion between local time and server time.
Friends, Need help in trying to convert the datetime parameters entered locally in LONDON to those which reflect to here. The problem we have is DB Server in Newyork & Client application likely to run at both Newyork & London. What is the most feasible way to account the time difference between the parameters used for querying information from the server? We do not have the luxury & time for internationalization of the application and we are looking for a quick fix to account for the time difference. ex:- Records are timestamped on the server...

Time Conversion between local time and server time.
Time Conversion between local time and server time. Friends, Need help in trying to convert the datetime parameters entered locally in LONDON to those which reflect to here. The problem we have is DB Server in Newyork & Client application likely to run at both Newyork & London. What is the most feasible way to account the time difference between the parameters used for querying information from the server? We do not have the luxury & time for internationalization of the application and we are looking for a quick fix to account for the time difference. ex:- R...

This version of Microsoft Sql Server Management Studio can only be used to connect to Sql Server 2000 and Sql Server 2005 servers
When I connect SQL Server 2005 to a remote database i get the error: "This version of Microsoft Sql Server Management Studio can only be used to connect to Sql Server 2000 and Sql Server 2005 servers". Can I confirm it is because: the remote db is of SQL Server 2008? There is a soln mentioned in http://forums.asp.net/t/1324047.aspx Did anybody try this (installing 2008 express: http://www.microsoft.com/express/sql/download/)? I am just checking again, whether it will disturb my existing SQL Server installation, in any means...? Though it is mentioned that it will g...

Web resources about - SQL Server 2005 and conversion of date-time between time-zones - asp.net.sql-datasource

Gene conversion - Wikipedia, the free encyclopedia
Gene conversion is the process by which one DNA sequence replaces a homologous sequence such that the sequences become identical after the conversion ...

Sonny Bill Williams' transformation due to conversion to Islam, Anthony Mundine says
He went from being savaged for walking out on the Bulldogs to becoming one of the world's most respected rugby union stars. Anthony Mundine believes ...

Family of Enrique Marquez unaware of his 2014 marriage, conversion to Islam
The family members of Enrique Marquez, the man linked to the San Bernardino massacre, said they were unaware he was married or that he had converted ...

Christmas Verse: A tale of conversion or, as Christians view it, re-birth
The Journey of the Magi, T. S. Eliot 'A cold coming we had of it, Just the worst time of the year For a journey, and such a long journey: The ...

Revisiting Carlos Martinez's rotation conversion
... thanks to his pitch mix, then it sure sounded like it could be possible. Now, almost a full year later, I wanted to revisit Martinez's conversion. ...

Dow to Force Conversion of Buffett Preferreds If Rally Holds
Bloomberg Dow to Force Conversion of Buffett Preferreds If Rally Holds Bloomberg Dow Chemical Co., which has been paying $255 million annually ...

​Judge orders N.J. "gay conversion" nonprofit to close
Jews Offering New Alternatives for Healing, known as JONAH, ordered to cease operations within 30 days

Council votes to ban gay 'conversion' therapy in Cincinnati
Cincinnati follows four states and the District of Columbia banning the therapy, becoming the first city outside D.C. to do so.

Roth IRA conversion is complicated
Tax rules governing IRAs are complex and ever changing, so if you're considering a Roth conversion, do some legwork first.

Del Rio explains why Raiders went for late two-point conversion
... A's Sharks Warriors Kings 49ers Raiders Quakes Insiders More Tickets Shop Watch Del Rio explains why Raiders went for late two-point conversion ...

Resources last updated: 12/25/2015 7:13:49 PM