Month
 
日期序列号获得一年中的月份

语法

Declare Function Month ( ByVal date_serial As Double ) As Integer

用法

#include "vbcompat.bi"
result = Month( date_serial )

参数

date_serial
日期

返回值

从包含日期序列号格式的日期的变量返回月份号。

月份值在1-12之间为1,1月为12,12月为12。

说明


编译器将不会识别此函数,除非包含vbcompat.bi.

例子

#include "vbcompat.bi"

Dim a As Double = DateSerial(2005,11,28) + TimeSerial(7,30,50)

Print Format(a, "yyyy / mm / dd hh:mm:ss"); Month(a)


与QB差别

  • 在QB中不存在该函数出现在PDS和VBDOS中

参考