What do you want to save?
Add Code snippet
New code examples
-
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 21:32:04
how to print date like 10-may-2018 in javascript
date.toString('YYYY-MM-dd'); 'Tue Feb 10 2015 15:42:50' var date = new Date('4-1-2015'); date.getDay();// returns 3 date.getYear();// returns 115, no of years after 1900 date.getFullYear();// returns 2015 date.getMonth();// returns 3, starting 0... Add solution -
Javascript 2021-10-13 13:27:11
get the name of month without using hard coded arrays in javascript
'use strict'; (function(d){ var mL = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; var mS = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'July', 'Aug', 'Sept', 'Oct', 'N... 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