[资料]VB-日期函数总结

作者在 2007-09-03 07:18:00 发布以下内容

VB-日期函数

函数名
函数功能
语法结构

DATE 函数
返回包含系统日期的VARIANT(DATE) 。
DATE

DATEADD函数
返回包含一个日期的VARIANT(DATE) ,这个日期还加上了一段时间间隔。
DateAdd(interval,number,date)

DateDiff函数
返回Variant(Long)的值,表示两个指定日期间的时间间隔数目。
DateDiff (interval,date1,date2,firstdayofweek [,firstweekofyear])

DatePart函数
返回一个包含已知日期的指定时间部分的Variant(Integer)
DatePart(interval,date[,firstdayofweek][,firstweekofyear ] )

DateSerial函数
返回包含指定的年月日的Variant(Date)
DateSerial( year ,month ,day )

DateValue函数
返回一个Variant(Date)
DateValue(Date)

Day函数
返回一个Variant(Integer) ,其值为1到31之间的整数,表示一个月中的某一日
Day(Date)

Hour函数
返回一个Variant(Integer) ,其值为0到23之间的整数,表示一天之中的某一个钟点
Hour(time)

Minute函数
返回一个Variant(Integer) ,其值为0到59之间的整数,表示一个小时中的某一分钟
Minute(time

Now函数
返回一个Variant(Date) ,根据计算机系统设置的日期和时间来指定日期和时间
Now

Second函数
返回一个Variant(Integer) ,其值为0到59之间的整数,表示一分钟之内的某一秒钟
Second(time)

Time函数
返回一个指明当前系统时间的Variant(Date)
Time

Time语句
设置系统时间
Time = time

Timer函数
返回一个Single,代表从午夜开始到现在所经过的秒数
Timer

TimeSerial函数
数 返回一个Variant(Date) ,包含具有现在时、分、秒的时间。
TimeSerial(hour,minute,second)

TimeValue函数
返回一个包含时间的Variant(Date)
TimeValue(time)

Weekday函数
返回一个Variant(Integer) ,包含一个整数,代表某个日期是星期几
Weekday(date[,firstdayofweek])

Year函数
返回一个Variant(Integer) ,包含表示年份的整数
Year(Date)

默认分类 | 阅读 2251 次
文章评论,共0条
游客请输入验证码
浏览592335次