Sybase时间日期函数
<div class="blog_content">日期相减: year, month, day, hour, minute, second带入:参数1 DateDiff(参数1,时间1,时间2) 期函数 getdate()
得到当前时间,可以设置得到各种时间格式.
datepart(日期部分,日期) 取指定时间的某一个部分,年月天时分秒.
datediff(日期部分,日期1,日期2) 计算指定的日期1和日期2的时间差多少.
dateadd(日期部分,数值表达式,日期) 计算指定时间,再加上表达式指定的时间长度.
--取时间的某一个部分
select datepart(yy,getdate()) --year select datepart(mm,getdate()) --month select datepart(dd,getdate()) --day select datepart(hh,getdate()) --hour select datepart(mi,getdate()) --min select datepart(ss,getdate()) --sec
页:
[1]