杰网资源 Design By www.escxy.com
直接上代码:
CREATE FUNCTION UNIX_TIMESTAMP (@ctimestamp datetime) RETURNS integer AS BEGIN /* Function body */ declare @return integer SELECT @return = DATEDIFF(SECOND,{d '1970-01-01'}, @ctimestamp) return @return END CREATE FUNCTION from_unixtime (@ts integer) RETURNS datetime AS BEGIN /* Function body */ declare @return datetime select @return = DATEADD(second, @ts, {d '1970-01-01'}) return @return END
用法
跟MySQL下的一样类似:
select dbo.UNIX_TIMESTAMP('2013-1-1') select dbo.from_unixtime(2145000000)
杰网资源 Design By www.escxy.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
杰网资源 Design By www.escxy.com
暂无评论...