首 页 ASP ASP.NET PHP JSP Ajax DIV+CSS JavaScript XML C#
MySQL MSSQL Access Oracle Linux Server 电脑技巧 网络安全 建站经验 其它

日期函数

整理日期:2007年08月12日 【字体:

昨天用到了一些日期函数,简单记录如下:
  SELECT DATEPART(month, '2007-02-14')
  返回 10 (等同于month('2007-02-14'))
  select datepart(weekday,getdate())
  返回1-7 1为星期天
  select datename(weekday,getdate())
  返回 星期(-到日)

select datediff(day,'2007-02-10',getdate())
返回 4

select getdate()
输出:2007-02-14 10:24:51.450
select convert(varchar(10),getdate(),120)
输出:2007-02-14


以下记录些与日期相关的函数


伊图教程网[www.etoow.com]
http://www.etoow.com/html/2007-08/1186929277.html
GetDate( ) 返回系统目前的日期与时间
Tags:
日期函数
'http://www.etoow.com/html/2007-08/1186929277.html
1
 
信息搜索
  
联系我们关于本站广告服务设为首页 收藏本站友情链接网站地图
Copyright © Etoow.com Inc. All Rights Reserved