T-SQL version of MySQL CURTIME ()

I am trying to get the 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 in T-SQL there is no CURTIME () function

Does anyone know of a solution?

thanks

Kevin

+7
source share
3 answers
+9
source

getdate() is MSSQL specific, but current_timestamp() is more standard. See Similar question: Getting date on sql server, CURRENT_TIMESTAMP and GetDate ()

0
source

In SQL2012, usage can be converted to certain types of date and time, for example.

  SELECT Time = CONVERT(TIME, GETDATE()), Date = CONVERT(DATE, GETDATE()) 
0
source

All Articles