What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-10-19 18:40:10
nodejs date add days
function addDays(originalDate, days){ cloneDate = new Date(originalDate.valueOf()); cloneDate.setDate(cloneDate.getDate() + days); return cloneDate; } let appointment = new Date("February 12, 2021 00:00:00"); let newAppointment = addDays(... Add solution -
Javascript 2021-10-19 17:40:14
today tomorrow day after tomorrow button html and javascript
const tomorrow = new Date() // add 1 day to today tomorrow.setDate(new Date().getDate() + 1) console.log(tomorrow) const dayAfterTomorrow = new Date() // add 2 day to today dayAfterTomorrow.setDate(new Date().getDate() + 2) console.log(dayAfterTomorrow)... Add solution -
Other 2021-10-19 16:54:10
formatd moongodb createdAt
date = new Date('Thu Dec 29 2011 20:14:56 GMT-0600 (CST)') date.toDateString() // "Thu Dec 29 2011" date.toUTCString() // "Fri, 30 Dec 2011 02:14:56 GMT" date.getMonth() // 11 date.getDate() // 29 date.getFullYear() // 2011 Add solution -
Javascript 2021-10-18 04:36:06
new Date() get speicifc hours min sec
new Date().getDate() // Get the day as a number (1-31) new Date().getDay() // Get the weekday as a number (0-6) new Date().getFullYear() // Get the four digit year (yyyy) new Date().getHours() // Get the hour (0-23) new Dat... Add solution -
Javascript 2021-10-13 19:55:04
get current time in javascript
// these are the most useful ones IMO var time = new Date(); time.getDate(); // returns value 1-31 for day of the month time.getDay(); //returns value 0-6 for day of the week time.getFullYear(); //returns a 4 digit value for the current year time.getHours... Add solution -
Javascript 2021-10-13 00:45:10
get date in javascript
var d= new Date(); d.getFullYear();//Get the year as a four digit number (yyyy) d.getMonth();//Get the month as a number (0-11) d.getDate();//Get the day as a number (1-31) d.getHours();//Get the hour (0-23) d.getMinutes();//Get the minute (0-59) d.getSec... Add solution -
Javascript 2021-10-12 05:20:06
javascript format date mm/dd/yyyy
var today = new Date(); var dd = String(today.getDate()).padStart(2, '0'); var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0! var yyyy = today.getFullYear(); today = mm + '/' + dd + '/' + yyyy; document.write(today); Add solution -
Javascript 2021-10-12 02:44:10
getdate yyyy mm dd format javascript
var today = new Date(); var dd = String(today.getDate()).padStart(2, '0'); var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0! var yyyy = today.getFullYear(); today = mm + '/' + dd + '/' + yyyy; document.write(today); Add solution -
Other 2021-10-11 13:32:07
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(&q... Add solution