Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Convert Datetime to Unix time

Author  Topic 

ganeshkumar08
Posting Yak Master

187 Posts

Posted - 2010-07-15 : 06:42:54
Hi All,

I need a sql statement to convert the current datetime value to Unix time format(i.e, In seconds). how to do it.

Thanks


Solutions are easy. Understanding the problem, now, that's the hard part

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2010-07-15 : 07:09:46
DATEDIFF(SECOND, '19700101', GETDATE())



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

ganeshkumar08
Posting Yak Master

187 Posts

Posted - 2010-07-15 : 07:37:29
Thanks Peso

Solutions are easy. Understanding the problem, now, that's the hard part
Go to Top of Page
   

- Advertisement -