sql server中 datetime转int的语句

2024-12-16 16:49:36
推荐回答(2个)
回答1:

declare @d datetimeset @d= '2009-5-22' select convert(int,cast(@d as datetime),120)

回答2:

select datediff(second,'1970-01-01',@d)