I need to get the date time in years,month,day,hours,minute,seconds,milliseconds in this format
201802281007475001
right now i managed to return this:
2018418112252159
This is my code:
var date = new Date();
blockid = JSON.stringify(date.getFullYear()) + JSON.stringify(date.getMonth()+1) + JSON.stringify(date.getDate()) + JSON.stringify(date.getHours()) + JSON.stringify(date.getMinutes()) + JSON.stringify(date.getSeconds()) + JSON.stringify(date.getMilliseconds())
I also need to put a zero in front of the month
and the day
in case it is minor than 10
.