Added year to timestamp.

This commit is contained in:
Michael Mathews 2011-02-26 10:47:46 +00:00
parent 86e91ca052
commit 8ccb4189a3

View File

@ -71,14 +71,14 @@ var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
/** /**
* Create a timestamp string. * Create a timestamp string.
* @returns {string} Like 26 Feb 16:19:34 * @returns {string} Like 26 Feb 2011 16:19:34
*/ */
exports.timestamp = function() { exports.timestamp = function() {
var d = new Date(); var d = new Date();
var time = [pad(d.getHours()), var time = [pad(d.getHours()),
pad(d.getMinutes()), pad(d.getMinutes()),
pad(d.getSeconds())].join(':'); pad(d.getSeconds())].join(':');
return [d.getDate(), months[d.getMonth()], time].join(' '); return [d.getDate(), months[d.getMonth()], d.getFullYear(), time].join(' ');
} }
exports.log = function(msg) { exports.log = function(msg) {