Home > Web Front-end > JS Tutorial > How to use the setMinutes() method to process time in JavaScript

How to use the setMinutes() method to process time in JavaScript

PHPz
Release: 2018-10-12 15:46:54
Original
1467 people have browsed it

The javascript Date.setMinutes() method sets minutes to a specified date according to the local time

Syntax

Date.setMinutes(minutesValue[, secondsValue[, msValue]])
Copy after login

Note: Appearance and data within brackets are optional

The following are the details of the parameters:

  • minutesValue: between 0 and 59 An integer representing minutes

  • secondsValue: An integer between 0 and 59 representing seconds. If you specify the secondsValue parameter, you must also specify minutesValue

  • msValue: a number between 0 and 999, representing milliseconds. If the msValue parameter is specified, minutesValue and secondsValue must also be specified

If the secondsValue and msValue parameters are not specified, the value returned from getSeconds and the getMilliseconds method are used

Return value:

  • NA

Example:

JavaScript setMinutes Method
Copy after login

For more related tutorials, please visit JavaScript Tutorial

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template