programming-examples/js/Date/Write a JavaScript function to get a full numeric representation of a year (4 digits)..js
2019-11-15 12:59:38 +01:00

9 lines
186 B
JavaScript

function full_year(dt)
{
return dt.getFullYear();
}
dt = new Date();
console.log(full_year(dt));
dt = new Date(2015, 10, 1);
console.log(full_year(dt));