日期字符串要先拼成标准的时间格式“2017-01-01 00:00:00”,然后用cast转成datetime 型
SELECT DATEDIFF(s, '1970-01-01 00:00:00', cast('2017-01-01 00:00:00' as datetime ))