You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MomentJS is a very popular JavaScript library used to get formatted date strings. Might be your best friend.
However, if you're looking to do it with plain JavaScript, this method should work:
consttoday=newDate();constmm=today.getMonth()+1;// getMonth() is zero-basedconstdd=today.getDate();consttodayFormatted=[today.getFullYear(),(mm>9 ? '' : '0')+mm,(dd>9 ? '' : '0')+dd].join('');// date in YYYYMMDD
YYYYMMDD of today
The text was updated successfully, but these errors were encountered: