Skip to navigation
How to convert a JavaScript date object to a ISO 112 date representation
19.05.16
112 has the string date representation of yyyymmdd to get this from javascript do: var d = new Date(); var sd = d.getFullYear() + '' + ('0' + (d.getMonth()+1)).slice(-2) + '' + ('0' + d.getDate()).slice(-2) + ''
http://www.w3schools.com/sql/func_convert.asp
Reply
Anonymous
pad(number) { if (number < 10) { return '0' + number; } return number; } let _date = new Date(); let d112 = _date.getUTCFullYear() + '' + this.pad(_date.getMonth() + 1) + '' + this.pad(_date.getDate()) + '' + this.pad(_date.getHours()) + '' + this.pad(_date.getMinutes()) + '';
19.05.16
Reply
Anonymous
Information Epoch 1711708805
Distrust all claims for one true way.
Home
Notebook
Contact us