javascript setMinutes() 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
minute
英['mɪnɪt ] 美[ˈmɪnɪt]
n. Minutes, minutes; instants, moments; memorandum; meeting minutes
vt. Record... in a record; measure time for...
adj .Tiny; insignificant; careful
Third person singular: minutes Plural: minutes Present participle: minuting Past tense: minuted Past participle: minuted
javascript setMinutes() methodsyntax
Function:Set the minute field of the specified time.
Syntax: dateObject.setMinutes(min,sec,millisec)
Parameters: min Required. A value representing minutes, between 0 ~ 59, in local time (the same below). sec is optional. A value representing seconds, between 0 and 59. Before EMCAScript was standardized, this parameter was not supported. 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 setMinutes() methodexample
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <script type="text/javascript"> //通过 setMinutes() 方法把当前时间的分钟字段设置为 01 var d = new Date() d.setMinutes(1) document.write(d) </script> </body> </html>
Click the "Run instance" button to view the online instance