自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

幾種常用VB.NET時(shí)間函數(shù)介紹

開發(fā) 后端
使用VB.NET進(jìn)行實(shí)際編程時(shí),會(huì)發(fā)現(xiàn)其中每一個(gè)函數(shù)都有自己特定的功能。比如我們這里為大家介紹的VB.NET時(shí)間函數(shù)就是其中一個(gè)功能強(qiáng)大的函數(shù)。

對(duì)于VB.NET中的函數(shù),在學(xué)習(xí)的過程中需要從各個(gè)方面去進(jìn)行日常的經(jīng)驗(yàn)積累,才能方便我們?nèi)蘸笫褂谩T谶@里就先為大家介紹兩種常用的VB.NET時(shí)間函數(shù),方便大家參考學(xué)習(xí),增加自己對(duì)VB.NET編程的理解。#t#

VB.NET時(shí)間函數(shù)之函數(shù)Dateadd() 

功能:計(jì)算某個(gè)指定的時(shí)間和 

格式: dateadd(timeinterval,number,date) 

參數(shù):timeinterval是時(shí)間單位(月,日..); number是時(shí)間間隔值,date是時(shí)間始點(diǎn). 

例子: 

  1. < %    
  2. currentDate = #8/4/99#    
  3. newDate = DateAdd
    (“m”,3,currentDate)    
  4. response.write newDate    
  5. %>   
  6. < %currentDate = 
    #12:34:45 PM#    
  7. newDate = DateAdd
    (“h”,3,currentDate)    
  8. response.write newDate    
  9. %>   

結(jié)果: 
11/4/99 
3:34:45 PM 
其中 
“m” = ”month”; 
“d” = ”day”; 
如果是currentDate 格式,則, 
“h” = ”hour”; 
“s” = ”second”;
 
VB.NET時(shí)間函數(shù)之函數(shù)Datediff() 

功能:計(jì)算某量個(gè)指定的時(shí)間差 

格式: datediff(timeinterval,date1,date2[,firstdayofweek[,firstdayofyear]]) 

參數(shù): timeinterval 是時(shí)間單位; date1,date2是有效的日期表達(dá)式,firstdayofweek,firstdayofyear 是任意選項(xiàng). 

例子: 

  1. < %fromDate = #8/4/99#    
  2. toDate = #1/1/2000#    
  3. response.write ”There 
    are ” & _    
  4. DateDiff(“d”,fromDate,
    toDate) & _    
  5. “ days to millenium 
    from 8/4/99.”    
  6. %>   

結(jié)果:There are 150 days to millenium from 8/4/99. 

責(zé)任編輯:曹凱 來(lái)源: 博客園
相關(guān)推薦

2010-01-12 09:37:48

VB.NET調(diào)用IE

2009-10-28 09:55:29

VB.NET MyCl

2009-11-10 12:06:17

VB.NET字符串函數(shù)

2009-10-15 17:50:48

VB.NET Spli

2009-10-21 10:45:50

VB.NET Quic

2009-11-10 10:28:20

VB.NET誕生

2009-10-12 15:02:51

VB.NET動(dòng)態(tài)控件

2010-01-21 16:45:00

VB.NET繼承規(guī)則

2010-01-07 15:25:11

VB.NET數(shù)組

2010-01-22 10:41:33

VB.NET聲明結(jié)構(gòu)

2009-10-12 13:19:14

VB.NET線程同步

2009-11-10 12:42:47

VB.NET Prin

2010-01-07 16:08:45

VB.NET子過程和函

2010-01-18 10:33:28

VB.NET基本函數(shù)

2009-10-26 10:44:27

VB.NET API函

2009-10-28 15:01:59

VB.NET SHEL

2009-11-02 13:14:18

VB.NET函數(shù)

2009-10-26 16:53:00

VB.NET常用代碼

2010-01-18 11:20:13

VB.NET默認(rèn)屬性

2009-08-18 16:57:24

VB.NET和C#
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)