ASP中DateAdd函數(shù)日期使用_ASP教程
推薦:ASP獲取地址欄URL地址方法如果要想獲取這樣的地址:http://192.168.0.5/super/super_article.asp?id=4 那么我們就只要獲取: 192.168.0.5---%=Request.ServerVariables(HTTP_HOST)%br /super/super_article.asp-----%=Request.ServerVariables(URL)%br id=4----%=Request.ServerVariables(QUERY
ASP中DateAdd函數(shù)用法
2006/09/22 12:29
注意vbs中和sql中寫法略有不同,以下帖出的為vbs幫助。
sql的可搜索sql自帶幫助文檔
字符串表達(dá)式,表示要添加的時(shí)間間隔。有關(guān)數(shù)值,請參閱"設(shè)置"部分。
返回已添加指定時(shí)間間隔的日期。
DateAdd(interval, number, date)
參數(shù)
interval
必選項(xiàng)。
number
必選項(xiàng)。數(shù)值表達(dá)式,表示要添加的時(shí)間間隔的個(gè)數(shù)。數(shù)值表達(dá)式可以是正數(shù)(得到未來的日期)或負(fù)數(shù)(得到過去的日期)。
date
必選項(xiàng)。Variant 或要添加 interval 的表示日期的文字。
設(shè)置
interval 參數(shù)可以有以下值:
table
說明
可用 DateAdd 函數(shù)從日期中添加或減去指定時(shí)間間隔。例如可以使用 DateAdd 從當(dāng)天算起 30 天以后的日期或從現(xiàn)在算起 45 分鐘以后的時(shí)間。要向 date 添加以"日"為單位的時(shí)間間隔,可以使用"一年的日數(shù)"("y")、"日"("d")或"一周的日數(shù)"("w")。
DateAdd 函數(shù)不會返回?zé)o效日期。如下示例將 95 年 1 月 31 日加上一個(gè)月:
NewDate = DateAdd("m", 1, "31-Jan-95")在這個(gè)示例中,DateAdd 返回 95 年 2 月 28 日,而不是 95 年 2 月 31 日。如果 date 為 96 年 1 月 31 日,則返回 96 年 2 月 29 日,這是因?yàn)?1996 是閏年。
如果計(jì)算的日期是在公元 100 年之前,則會產(chǎn)生錯(cuò)誤。
如果 number 不是 Long 型值,則在計(jì)算前四舍五入為最接近的整數(shù)。
分享:FSO組件之CreateTextFile方法介紹object.CreateTextFile(filename[, overwrite[, unicode]]) 參數(shù):object 必選項(xiàng)。 應(yīng)為 FileSystemObject 或 Folder 對象的名稱。 filename 必選項(xiàng)。 指明所要?jiǎng)?chuàng)建文件的字符串表達(dá)式。 overwrite 可選項(xiàng)。 Boolean 值,指明能否覆蓋已有文件。 如果文件可以覆蓋,則
- asp FSO 讀寫文件本文件實(shí)現(xiàn)代碼
- asp中isNull、isEmpty和空字符串的區(qū)別
- asp獲取用戶真實(shí)IP地址的方法
- asp連接sqlserver數(shù)據(jù)庫實(shí)現(xiàn)代碼
- asp中正則表達(dá)式過濾html代碼函數(shù)
- asp中g(shù)et post提交表單區(qū)別
- 網(wǎng)頁模板:ASP內(nèi)建對象Request
- xmlhttp的open方法使用詳解
- ASP的常用的自定義函數(shù)大全
- asp中用for循環(huán)的一個(gè)小技巧
- eWebEditor v3.8 列目錄
- ASP無組件分頁實(shí)現(xiàn)思路及代碼
- 相關(guān)鏈接:
- 教程說明:
ASP教程-ASP中DateAdd函數(shù)日期使用
。