You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
function seconds_with_leading_zeros(dt)
|
|
{
|
|
return (dt.getMinutes() < 10 ? '0' : '') + dt.getMinutes();
|
|
}
|
|
|
|
dt = new Date();
|
|
console.log(seconds_with_leading_zeros(dt));
|
|
|
|
dt = new Date(1989, 10, 1);
|
|
console.log(seconds_with_leading_zeros(dt));
|