Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

date et heure javascript

//tableau des jours
var tableauJours = new Array(
    'dimanche',
    'lundi',
    'mardi',
    'mercredi',
    'jeudi',
    'vendredi',
    'samedi'
);

function afficherDateHeure()
{
    var dateGlobale = new Date ();
    //year
    var annee = dateGlobale.getFullYear();
    //month
    var mois = dateGlobale.getMonth();
    //day
    var jour = dateGlobale.getDay();

    //num of the day
    var numeroJour = dateGlobale.getDate();

    //reccuperation de l'heure
    var heure = dateGlobale.getHours();
    //recc des mins
    var minutes = dateGlobale.getMinutes();
    //recc des sec
    var secondes = dateGlobale.getSeconds();

    //on assigne le bon jour
     jour = tableauJours[jour];

    //hour
    var date = document.getElementById("date");

    date.innerHTML = "aujourd'hui c'est:" + jour;

    var heures = document.getElementById("heures");

    heures.innerHTML = "Heure actuelle est:" +" "+ heure +":"+minutes +":"+secondes;
}

function afficherChaqueSecondeHeure()
{
    afficherDateHeure();

}
Comment

PREVIOUS NEXT
Code Example
Javascript :: blockchain.info/pushtx 
Javascript :: GLTF position three.js 
Javascript :: &nbsp replace javascript 
Javascript :: react native paper status bar color 
Javascript :: convert todays date to json datetime 
Javascript :: This shorthand syntax is also known as the concise method syntax. It’s valid to have spaces in the property name. 
Javascript :: how-to get selected value of a dropdown menu in reactjs 
Javascript :: fetch Mongodb find() results with Backbone 
Javascript :: Print the third number from right 
Javascript :: How to Compare Strings Using localeCompare 
Javascript :: Change Name Of Function Constructor 
Javascript :: a critical point in an array is defined as either a local maxima or a local minima 
Javascript :: check if function exists 
Javascript :: Combine multiple JSONs Into One 
Javascript :: select angular onchange 
Javascript :: react.js form 
Javascript :: angular auth guard @medium 
Javascript :: get file name with extension netsuite suitescript 
Javascript :: react form validation with logic boolean, string and number 
Javascript :: js calculate hours between two times 
Javascript :: kayengxiong promise js 
Javascript :: routing with django and react 
Javascript :: NodeJS Multi-Core Processors Example 
Javascript :: js number power/exponetion 
Javascript :: get 3 random items from array javascript 
Javascript :: router.put method 
Javascript :: lookup objects 
Javascript :: html video api set speed 
Javascript :: pass a callback funcion into an async function node js 
Javascript :: jsdoc run for all files in folder 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =