Reputation: 65
This should be simple math buy I just can't deduce it at the moment. getTime() should return a unix time stamp in milli-seconds and from there one should be able to figure out the year.
function theYear(timestamp){
// answer
return year;
}
Upvotes: 0
Views: 83
Reputation: 41737
function theYear(timestamp){
return new Date(timestamp).getYear();
}
Upvotes: 0