mssql 中 php time() 的等价物是什么? [英] What's the equivalent of php time() in mssql?
本文介绍了mssql 中 php time() 的等价物是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
例如,如果我在 Windows 7 下执行以下代码 - 我在 Windows 7/IIS 下运行 PHP.
For example if I execute the code below under my Windows 7-I have PHP running under windows 7/IIS.
echo time() I will get this 1304972050
如何在 MSSQL 中获得相同的结果?
How can I get the same result in MSSQL?
推荐答案
SELECT DATEDIFF(ss, '1/1/1970 05:00:00', GETUTCDATE())
应该这样做.
根据评论更新.
这篇关于mssql 中 php time() 的等价物是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文