?? hi?n th? Ng�y th�ng n?m hi?n t?i ta c� th? d�ng h�m Date() v� Th?i gian v?i H�m Time(). C�n ?? hi?n th? c�ng l�c Ng�y th�ng n?m v� Th?i gian ta c� th? d�ng H�m Now(). D??i ?�y l� b?ng h??ng d?n s? d?ng hai H�m n�y:
Ng�ai ra b?ng c�ch d�ng c�c tham s? v� m?nh ?? ?i?u ki?n, ta c� th? bi?n h�a ?? hi?n th? Date v� Time theo � mu?n. V� D?: Vi?t K?t Qu? Hi?n Th?: <%= time()%> Time()Gi? tr�n Server) <%=date()%> " & Date() & " <%=now()%> 9/17/2006 11:25:16 PM <% Response.Write("Ng�y gi? hi?n t?i: "&now())%> Ng�y gi? hi?n t?i(Server): 9/17/2006 11:25:16 PM <%= FormatDateTime(Date, 0)%> 9/17/2006 <%= FormatDateTime(Date, 1)%> Sunday, September 17, 2006 <%= FormatDateTime(now, 3)%> 11:25:16 PM <%= FormatDateTime(now, 4)%> 23:25 <%response.write("Day of the week: "&WeekDay(Date))%> Day of the week: 1 <%response.write("Day of the month: "&Day(Date))%> Day of the month: 17 <%response.write("Current Year: "&Year(Date))%> Current Year: 2006 <%response.write("Current Year: "&Right(Year(Date),2))%> Current Year: 06 <%response.write("Today is: "&WeekDayName(WeekDay(Date)))%> Today is: Sunday <%response.write("Hour Part: "&(hour(now)))%> Hour part: 23 <%response.write("Minute Part: "&Minute(now()))%> Minute part: 25 <%response.write("Second Part: "&Second(now()))%> Second part: 16
Đăng nhận xét