TimeValue
 
从时间字符串获取日期序列号

语法

Declare Function TimeValue ( ByRef timestring As String ) As Double

用法

#include "vbcompat.bi"
result = TimeValue( timestring )

参数

timestring
要转换的字符串

返回值

从时间字符串返回日期序列号.

说明


时间字符串的格式必须为"23:59:59""11:59:59PM"

除非包含vbcompat.bidatetime.bi,否则编译器将无法识别此函数。

例子

#include "vbcompat.bi"

Dim ds As Double = TimeValue("07:12:28AM")

Print Format(ds, "HH:MM:SS")


与QB差别

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

参考