Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 831
  • Last Modified:

How Do i run GETUTCDATE()

Can someone give the syntact to get the GMT date from sql, thanks
0
tomhoran
Asked:
tomhoran
  • 2
  • 2
1 Solution
 
namasi_navaretnamCommented:
declare @mydate datetime
select @mydate = GETUTCDATE()
print @mydate

HTH
0
 
tomhoranAuthor Commented:
HTH,

I'm trying to get this value into a VB program, how do i do that? Thanks. Tom
0
 
tomhoranAuthor Commented:
HTH,

CAn i do it via a select statment or comething??
0
 
namasi_navaretnamCommented:
Yes.

Run this query the same way you run other queries in VB. If using ado execute this sql and get the result into a resultset object and then read gmtdate field.

select  GETUTCDATE() as gmtdate


0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now