var yyyymmddhhmsms = function() { var date = new Date(); var yyyy = date.getFullYear(); var mm = date.getMonth() + 1; var dd = date.getDate(); var hh = date.getHours(); var m = date.getMinutes(); var s = date.getSeconds(); var ms = date.getMilliseconds(); return yyyy + mm + dd + hh + m + s + ms; };