get Today Date Function , #get current date using javaScripts

 Today date Functions

 

export function getTodayDate() {
  var today = new Date();
  var dd = today.getDate();
  var mm = today.getMonth() + 1;
  var yyyy = today.getFullYear();

  if (dd < 10) {
    dd = '0' + dd;
  }

  if (mm < 10) {
    mm = '0' + mm;
  }
  const todayDAte = yyyy + '-' + mm + '-' + dd;
  return todayDAte
}

 https://freecodesmasters.blogspot.com/2020/09/today-date-function.html

Comments

Popular posts from this blog

Image Preview Before upload image into ReactJs

Format mobile number to this format "(845) 963-2545" #mobileFormat