VBScript DatePart 함수
❮ 완전한 VBScript 참조DatePart 함수는 주어진 날짜의 지정된 부분을 반환합니다.
통사론
DatePart(interval,date[,firstdayofweek[,firstweekofyear]])
Parameter | Description |
---|---|
interval | Required. The interval of time to return. Can take the following values:
|
date | Required. Date expression to evaluate |
firstdayofweek | Optional. Specifies the day of the week. Can take the following values:
|
firstweekofyear | Optional. Specifies the first week of the year. Can take the following values:
|
예
실시예 1
날짜에서 월 가져오기:
<%
d=CDate("2010-02-16")
response.write(DatePart("m",d))
%>
위 코드의 출력은 다음과 같습니다.
2
실시예 2
우리가 속한 달을 얻으십시오:
<%
response.write(DatePart("m",Now()))
%>
위 코드의 출력은 다음과 같습니다.
1
실시예 3
시간 가져오기:
<%
response.write(DatePart("h",Now())
%>
위 코드의 출력은 다음과 같습니다.
13
❮ 완전한 VBScript 참조