Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

T-SQL version of MySQLs CURTIME()

I am trying to get teh current time as a unix timestamp from my MSSQL database.

In Mysql I could say something like:

SELECT id,
            caregiver_id,
            client_id,
            week_no,
            CURTIME() as Synch_Time
FROM dbo.Visits 

But THERE is no CURTIME() function in T-SQL

Does anyone know of a solution?

Thanks

Kevin

like image 493
Kevin Bradshaw Avatar asked May 18 '11 12:05

Kevin Bradshaw


1 Answers

You can use getdate() and do some calculations described here. http://mysql.databases.aspfaq.com/how-do-i-convert-a-sql-server-datetime-value-to-a-unix-timestamp.html

like image 116
Mikael Eriksson Avatar answered Nov 12 '22 02:11

Mikael Eriksson