javascript setSeconds() method
Translation results:
set
英[set] 美[sɛt]
vt. Set; place, arrange; put in a certain situation; place tableware
vi. Setting off; setting off; condensation
n.Gathering; a set; a set; a TV set
adj. Fixed; located in...; stubborn; arranged The
third person singular: sets plural: sets present participle: setting past tense: set past participle: set
second
英[ˈsekənd] Beauty [ˈsekənd]
n.Second; instant; inferior goods; second portion of food
adj.Second; secondary; second place; other
adv.Second;Secondly;In the second place
vt.Support;temporary assignment;seconding;agree with the proposal
Third person singular: seconds Plural: seconds Present participle: seconding Past Formula: seconded Past participle: seconded
javascript setSeconds() methodsyntax
Function:Set the seconds in the Date object
Syntax: dateObject.setSeconds(sec,millisec)
Parameters: sec Required. A value representing seconds as an integer between 0 and 59. millisec Optional. A value representing milliseconds, between 0 and 999. Before EMCAScript was standardized, this parameter was not supported.
Returns: The millisecond representation of the adjusted date. Before ECMAScript was standardized, this method returned nothing.
Note: If one of the above parameters is specified with a one-digit number, JavaScript will add one or two leading 0s to the result. This method is always used in conjunction with a Date object.
javascript setSeconds() methodexample
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <script type="text/javascript"> //通过 setSeconds() 方法把当前时间的秒字段设置为 01 var d = new Date() d.setSeconds(1) document.write(d) </script> </body> </html>
Run instance »
Click the "Run instance" button to view the online instance