SQL Basics

 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me



Go Back   Tutorialized ForumsDatabasesSQL Basics

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
  #1  
Old November 3rd, 2015, 01:33 AM
Thinker8 Thinker8 is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Nov 2015
Posts: 2 Thinker8 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 57 sec
Reputation Power: 0
How to convert local server time to GMT

Hi,

I want to convert local server time to GMT in sql. Tried with the below query but its not working.

Code:
select sysdate, convert_timezone('GMT', sysdate) from dual;


Please advise.

Thanks.

Reply With Quote
  #2  
Old November 10th, 2015, 04:54 AM
clapcreative clapcreative is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Nov 2015
Posts: 2 clapcreative User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 36 m 52 sec
Reputation Power: 0
Facebook
RE: How to convert local server time to GMT

You could do something like this:

Code:
declare @InputUtcDateTime datetime2 = '2011-05-20 06:30:18'

declare @LocalDateTime datetime2 = dateadd(minute, datepart(TZoffset, sysdatetimeoffset()), @InputUtcDateTime)
print @LocalDateTime

Reply With Quote
  #3  
Old January 29th, 2016, 03:33 AM
JebaQpt JebaQpt is offline
Banned
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Feb 2014
Posts: 12 JebaQpt User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 58 m 39 sec
Reputation Power: 0
Try this one
SELECT to_GMT(invoice_date) from INVOICES

Reply With Quote
Reply

Viewing: Tutorialized ForumsDatabasesSQL Basics > How to convert local server time to GMT


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.

© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap