Skip to content

DATESERIAL ​


创建日期序列

语法 ​

declare function DateSerial ( byval year as long, byval month as long, byval day as long ) as long

用法 ​

#include "vbcompat.bi"
result = DateSerial( year, month, day )

参数 ​

year

年份

month

月份(1-12)

day

日期(月中第几天)

返回值 ​

返回由 year、month 和 day 参数构成的日期所对应的日期序列。返回的日期序列没有小数部分。

说明 ​

除非包含 vbcompat.bi 或 datetime.bi,否则编译器不会识别此函数。

示例 ​

start GeSHi

vb
#include "vbcompat.bi"

Dim a As Long = DateSerial(2005, 11, 28)

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

end GeSHi

与 QB 的差异 ​

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

另请参阅 ​

返回 目录

基于 FreeBASIC 官方文档翻译 如有侵权请联系我们删除
FreeBASIC 是开源项目,与微软公司无隶属关系