JavaScript Date getMinutes() method - JavaScript Tutorial

JavaScript Date getMinutes() method

BLUF: This tutorial on JavaScript Date getMinutes() method provides an in-depth look at JavaScript's core features. It includes practical examples and code snippets to help you master modern JS development.
Key Discovery: JavaScript Date getMinutes() method

Understanding JavaScript Date getMinutes() method is crucial for building dynamic, interactive web applications. Explore the examples below to see it in action.

The getMinutes method in JavaScript retrieves the minutes component from a given date, based on the local time settings.

Syntax

The syntax for the getMinutes method is expressed as follows:

Example

dateObj.getMinutes()

Return

A whole number ranging from 0 to 59 that denotes the minute.

JavaScript Date getMinutes method example

In this section, we will explore the getMinutes method by examining a range of examples.

Example 1

Let’s examine an example that demonstrates how to display the current minute’s value.

Example

<script>

var min=new Date();

document.writeln(min.getMinutes());

</script>

Output:

Let's examine an example that demonstrates how to extract and display the minute component from a specified date.

Example

<script>

var min=new Date("August 15, 1947 20:22:10");

document.writeln(min.getMinutes());

</script>

Output:

Input Required

This code uses input(). Please provide values below:

Logic Practice
Install Logic Practice
Add to home screen for a faster app-like experience