JavaScript Date setUTCMinutes() Method

Definition and Usage

setUTCMinutes() The method sets the minutes of the date object based on UTC time.

Tip:Coordinated Universal Time (UTC) is the time set by the world time standard.

Note:UTC time is the same as GMT time (Greenwich Mean Time).

Instance

Example 1

Set the minutes according to UTC time to 17:

var d = new Date();
d.setUTCMinutes(17);

Try It Yourself

Example 2

Use UTC methods to set the date and time 90 minutes ago:

var d = new Date();
d.setUTCMinutes(d.getUTCMinutes() - 90);

Try It Yourself

Syntax

Date.setUTCMinutes(min, sec, millisec)

Parameter Value

Parameter Description
min

Required. Represents the integer of minutes.

Expected values are 0-59, but other values are allowed:

  • -1 will cause the last minute of the previous hour
  • 60 will cause the first minute of the next hour
sec

Optional. Represents the integer of seconds.

Expected values are 0-59, but other values are allowed:

  • -1 will cause the last second of the previous minute
  • 60 will cause the first second of the next minute
millisec

Optional. Represents the integer of milliseconds.

Expected values are 0-999, but other values are allowed:

  • -1 will cause the last millisecond of the previous second
  • 1000 will cause the first millisecond of the next second

Technical Details

Return value: A number, representing the number of milliseconds between the Date object and midnight on January 1, 1970.
JavaScript Version: ECMAScript 1

Browser Support

Method Chrome IE Firefox Safari Opera
setUTCMinutes() Support Support Support Support Support

Related Pages

Tutorial:JavaScript Date

Tutorial:JavaScript Date Format

Tutorial:JavaScript Date Setting Methods