DateSerial Function

Returns a Date value for a specified year, month, and day.

Syntax:


DateSerial (year, month, day)

Return value:

λ‚ μ§œ

Parameters:

Year: 연도λ₯Ό λ‚˜νƒ€λ‚΄λŠ” μ •μˆ˜ μ‹μž…λ‹ˆλ‹€. 0μ—μ„œ 99 μ‚¬μ΄μ˜ λͺ¨λ“  값은 1900-1999λ…„μœΌλ‘œ ν•΄μ„λ©λ‹ˆλ‹€. 이 λ²”μœ„λ₯Ό λ²—μ–΄λ‚˜λŠ” μ—°λ„μ˜ 경우 4자리 숫자λ₯Ό λͺ¨λ‘ μž…λ ₯ν•΄μ•Ό ν•©λ‹ˆλ‹€.

Month: μ§€μ •ν•œ μ—°λ„μ˜ 월을 λ‚˜νƒ€λ‚΄λŠ” μ •μˆ˜ μ‹μž…λ‹ˆλ‹€. ν—ˆμš©λ˜λŠ” λ²”μœ„λŠ” 1-12μž…λ‹ˆλ‹€.

Day: Integer expression that indicates the day of the specified month. The accepted range is from 1-31. No error is returned when you enter a non-existing day for a month shorter than 31 days.

DateSerial ν•¨μˆ˜λŠ” 1899λ…„ 12μ›” 30일뢀터 μ§€μ •ν•œ λ‚ μ§œκΉŒμ§€μ˜ 일 수λ₯Ό κ΅¬ν•©λ‹ˆλ‹€. 이 ν•¨μˆ˜λ₯Ό μ‚¬μš©ν•˜μ—¬ 두 λ‚ μ§œμ˜ μ°¨λ₯Ό 계산할 수 μžˆμŠ΅λ‹ˆλ‹€.

The DateSerial function returns the data type Variant with VarType 7 (Date). Internally, this value is stored as a Double value, so that when the given date is 1900-01-01, the returned value is 2. Negative values correspond to dates before December 30, 1899 (not inclusive).

ν—ˆμš©λ˜λŠ” λ²”μœ„λ₯Ό λ²—μ–΄λ‚˜λŠ” λ‚ μ§œλ₯Ό μ§€μ •ν•  경우 LibreOffice Basic은 였λ₯˜ λ©”μ‹œμ§€λ₯Ό ν‘œμ‹œν•©λ‹ˆλ‹€.

DateValue ν•¨μˆ˜κ°€ λ‚ μ§œλ₯Ό ν¬ν•¨ν•˜λŠ” λ¬Έμžμ—΄λ‘œ μ§€μ •λ˜λŠ” 반면 DateSerial ν•¨μˆ˜λŠ” 연도, μ›”, 일 λ“±κ³Ό 같은 각 맀개 λ³€μˆ˜λ₯Ό λ³„λ„μ˜ 숫자 μ‹μœΌλ‘œ ν‰κ°€ν•©λ‹ˆλ‹€.

Error codes:

5 잘λͺ»λœ ν”„λ‘œμ‹œμ € ν˜ΈμΆœμž…λ‹ˆλ‹€.

Example:


  Sub ExampleDateSerial
  Dim lDate As Long
  Dim sDate As String
      lDate = DateSerial(1964, 4, 9)
      sDate = DateSerial(1964, 4, 9)
      msgbox lDate REM returns 23476
      MsgBox sDate ' returns 1964-04-09 in ISO 8601 format
  End Sub

Please support us!