“Javascript Datum bis Stunden Minuten Sekunden” Code-Antworten

Javascript Datum bis Stunden Minuten Sekunden

function secondsToHms(d) {
    d = Number(d);
    var h = Math.floor(d / 3600);
    var m = Math.floor(d % 3600 / 60);
    var s = Math.floor(d % 3600 % 60);

    var hDisplay = h > 0 ? h + (h == 1 ? " hour, " : " hours, ") : "";
    var mDisplay = m > 0 ? m + (m == 1 ? " minute, " : " minutes, ") : "";
    var sDisplay = s > 0 ? s + (s == 1 ? " second" : " seconds") : "";
    return hDisplay + mDisplay + sDisplay; 
}
Vivacious Vendace

NEUE DATE () SPEICIFC STORL MIN SEC ERHALTEN

new Date().getDate()          // Get the day as a number (1-31)
new Date().getDay()           // Get the weekday as a number (0-6)
new Date().getFullYear()      // Get the four digit year (yyyy)
new Date().getHours()         // Get the hour (0-23)
new Date().getMilliseconds()  // Get the milliseconds (0-999)
new Date().getMinutes()       // Get the minutes (0-59)
new Date().getMonth()         // Get the month (0-11)
new Date().getSeconds()       // Get the seconds (0-59)
new Date().getTime()          // Get the time (milliseconds since January 1, 1970)
Xerothermic Xenomorph

Ähnliche Antworten wie “Javascript Datum bis Stunden Minuten Sekunden”

Fragen ähnlich wie “Javascript Datum bis Stunden Minuten Sekunden”

Weitere verwandte Antworten zu “Javascript Datum bis Stunden Minuten Sekunden” auf JavaScript

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen