How to get minutes in JavaScript.
var mydatetime = "31/01/2025 10:10:50" var minute = 10;
Hi makenzi.exc,
Use the getMinutes function of Date object to get the Minutes.
Refer below example.
HTML
<html> <head> <meta charset="utf-8" /> <title></title> <style type="text/css"> body { font-family: Arial; font-size: 10pt; } </style> </head> <body> <input type="button" value="Get Minutes" onclick="GetMinutes()" /> <script type="text/javascript"> function GetMinutes() { var myDate = "2025/01/31 10:12:50" //Convert Date string to Date object. var dt = new Date(myDate); // Get Minutes. var minutes = dt.getMinutes(); alert("Minute is: " + minutes); } </script> </body> </html>
Demo
Screenshot
Downloads
Download Sample
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.