L'objet Date en javascript permet de créer et manipuler des dates.
Exemple(s)
var maDate = new Date(); document.write(maDate.getDate());
Exemple(s)
var maDate = new Date(); document.write(maDate.getDay());
Exemple(s)
var maDate = new Date(); document.write(maDate.getHours());
Exemple(s)
var maDate = new Date(); document.write(maDate.getMinutes());
Exemple(s)
var maDate = new Date(); document.write(maDate.getMonth());
Exemple(s)
var maDate = new Date(); document.write(maDate.getTime());
Exemple(s)
var maDate = new Date(); document.write(maDate.getYear());
Exemple(s)
var timestamp = Date.parse("Apr 30, 2010"); document.write(timestamp);
Exemple(s)
var maDate = new Date(); maDate.setDate(1); document.write(maDate); // Ou document.write(maDate.toString());
Exemple(s)
var maDate = new Date(); maDate.setHours(1); document.write(maDate); // Ou document.write(maDate.toString());
Exemple(s)
var maDate = new Date(); maDate.setMinutes(1); document.write(maDate); // Ou document.write(maDate.toString());
Exemple(s)
var maDate = new Date(); maDate.setMonth(1); document.write(maDate); // Ou document.write(maDate.toString());
Exemple(s)
var maDate = new Date(); maDate.setSeconds(1); document.write(maDate); // Ou document.write(maDate.toString());
Exemple(s)
var maDate = new Date(); maDate.setTime(1520); document.write(maDate); // Ou document.write(maDate.toString());
Exemple(s)
var maDate = new Date(); maDate.setYears(2010); document.write(maDate); // Ou document.write(maDate.toString());
Articles susceptibles de vous intéresser