VBScript Second function
Definition and usage
The Second function can return a number representing the seconds of the minute, ranging from 0 to 59.
Syntax
Second(time)
Parameter | Beskrivning |
---|---|
time | Obligatorisk. Any expression that can represent time. |
Exempel
Exempel 1
D = #1/15/2002 10:55:51 AM# document.write(Second(D))
Uppgifter:
51
Exempel 2
T = #10:55:51 AM# document.write(Second(T))
Uppgifter:
51
Exempel 3
Följande exempel är en ASP-funktion som kan skriva ut kinesisk format tid, där används VBScript-funktionerna Hour, Minute och Second.
<% Sub HHMMSS(T) H = Hour(T) Om H<12 då Response.Write "morgon"&H&"klockan" Annars Response.Write "eftermiddag"&(H-12)&"klockan" End If Response.Write Minute(T)&"minuter" Response.Write Second(T)&"sekunder" End Sub %>