l am try to get timestamp format like this way 201909081015
with out using any hash or dash ! .
any idea to how to do this format ?
l am try to get timestamp format like this way 201909081015
with out using any hash or dash ! .
any idea to how to do this format ?
If UTC timezone will do,
new Date().toISOString().replace(/\D/g, '').substr(0, 12)
It would take more work to handle other timezone offsets.
This works by simply taking the typical toISOString()
format, then throwing away everything that isn't a digit, and trimming off anything beyond the minutes digits.
if you dont' want to use hash or dash, you can use different methods of Date() object like getFullYear, getMonth... etc. Live Example: Stackblitz