javascript format date yyyy-mm-dd
// yyyy-mm-dd
new Date().toISOString().slice(0, 10)
javascript format date yyyy-mm-dd
// yyyy-mm-dd
new Date().toISOString().slice(0, 10)
convert a new date standard to a yyy-mm-dd format in javascript
function convert(str) {
var date = new Date(str),
mnth = ("0" + (date.getMonth() + 1)).slice(-2),
day = ("0" + date.getDate()).slice(-2);
return [date.getFullYear(), mnth, day].join("-");
}
console.log(convert("Thu Jun 09 2011 00:00:00 GMT+0530 (India Standard Time)"))
//-> "2011-06-08"
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us