TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Santosh Sasupalli
NA
181
25.2k
convert local time to utc time
Sep 8 2016 2:48 AM
USE [Gamyam]<br />GO<br />/****** Object: UserDefinedFunction [dbo].[convertutcdatetime] Script Date: 9/8/2016 12:06:05 PM ******/<br />SET ANSI_NULLS ON<br />GO<br />SET QUOTED_IDENTIFIER ON<br />GO<br /><br />ALTER FUNCTION [dbo].[convertutcdatetime]()<br />RETURNS datetime <br />AS <br />BEGIN<br /> DECLARE @ret datetime;<br /> declare @Diff nvarchar(20)<br /> select @Diff=TimeZone from Country <br /> SELECT @ret = convert(Datetime,switchoffset (CONVERT(datetimeoffset, GETUTCDATE()),@Diff));<br /> <br /> RETURN @ret;<br />END;<br /><br /><div>is there any mistake </div><div> </div><div>i got an error like this:</div><div>Msg 9812, Level 16, State 0, Line 1<br />The timezone provided to builtin function switchoffset is invalid.</div><div> please rectify me inthat @diff i put +530 i got out put.in my table value also +530 but it doesnot work helpme</div>
Reply
Answers (
2
)
Question of sql server
SSRS Column Autofit when exported in Excel .