Skip to content

Commit

Permalink
Change date format to ISO8601 (aframevr#3203)
Browse files Browse the repository at this point in the history
Less ambiguous date format.
  • Loading branch information
edent authored and dmarcos committed Oct 30, 2017
1 parent 14027d3 commit 739427d
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions scripts/updateVersionLog.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,9 @@ gitRev.short(hash => {
});

/**
* @returns {string} of format `1-1-2017`.
* @returns {string} of format `2017-12-25`.
*/
function getBuildTimestamp () {
function pad2 (value) {
return ('0' + value).slice(-2);
}
const date = new Date();
const timestamp = [
pad2(date.getUTCDate()),
pad2(date.getUTCMonth() + 1),
date.getUTCFullYear()
];
return timestamp.join('-');
const timestamp = new Date().toISOString().slice(0, 10);
return timestamp;
}

0 comments on commit 739427d

Please sign in to comment.