Format date time as YYYY-MM-DD HH:MM:SS
What is a simple way format date time to YYYY-MM-DD HH:MM:SS?
new Date().toLocaleDateString('en-CA') + ' ' + new Date().toLocaleTimeString('zh-CN')
We often need this ISO format string. Is there another way to do it that is simpler?
Comments
Post a Comment