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
PHPzOriginal
2016-05-16 15:55:471466browse

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

Syntax

Date.setMinutes(minutesValue[, secondsValue[, msValue]])

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

For more related tutorials, please visit JavaScript Tutorial

Statement:
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