Contents
Index 🔎︎

# DateValue Function

從日期字串傳回日期值。此日期字串是單一數值形式的完整日期。您也可以使用此序號判斷兩個日期之差。

### Syntax:

      DateValue(date)

### Parameters:

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).

### Return value:

The computed date.

### 錯誤代碼：

5 無效的程序呼叫

### Example:

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