DateValue 函数

目录
索引 🔎︎

# DateValue Function

根据日期字符串返回日期值。日期字符串是以单个数值表示的完整日期。也可以使用此序列数确定两个日期之差。

### 语法:

      DateValue(date)

### 参数:

Date: String expression that contains the date that you want to calculate. In contrast to the DateSerial function that passes years, months and days as separate numeric values, the DateValue function requests the date string to be according to either one of the date acceptance patterns defined for your locale setting (see LibreOffice - PreferencesTools - Options - Language Settings - Languages) or to ISO date format (momentarily, only the ISO format with hyphens, e.g. "2012-12-31" is accepted).

### 返回值:

The computed date.

### 错误代码:

5 无效的过程调用

### 示例:

      Sub ExampleDateValue
          MsgBox DateValue("23/02/2011")
      End Sub