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일뢀터 μ§€μ •ν•œ λ‚ μ§œκΉŒμ§€μ˜ 일 수λ₯Ό κ΅¬ν•©λ‹ˆλ‹€. 이 ν•¨μˆ˜λ₯Ό μ‚¬μš©ν•˜μ—¬ 두 λ‚ μ§œμ˜ μ°¨λ₯Ό 계산할 수 μžˆμŠ΅λ‹ˆλ‹€.

DateSerial ν•¨μˆ˜λŠ” VarType 7(Date)μ΄λΌλŠ” Variant 데이터 ν˜•μ‹μ„ κ΅¬ν•©λ‹ˆλ‹€. λ‚΄λΆ€μ μœΌλ‘œ 이 값이 Double κ°’μœΌλ‘œ μ €μž₯되기 λ•Œλ¬Έμ— μ§€μ •ν•œ λ‚ μ§œκ°€ 1.1.1900일 경우 λ°˜ν™˜ 값은 2μž…λ‹ˆλ‹€. 음수 값은 1899λ…„ 12μ›” 30일 이전(ν¬ν•¨λ˜μ§€ μ•ŠμŒ)의 λ‚ μ§œμ— ν•΄λ‹Ήν•©λ‹ˆλ‹€.

ν—ˆμš©λ˜λŠ” λ²”μœ„λ₯Ό λ²—μ–΄λ‚˜λŠ” λ‚ μ§œλ₯Ό 지정할 경우 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 REM은 04/09/1964λ₯Ό λ°˜ν™˜ν•©λ‹ˆλ‹€.
  End Sub

Please support us!