get today date and time in js
var today = new Date();
var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
var dateTime = date+' '+time;
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 with jan
date.getUTCDate();// returns 31
Also in JavaScript:
- how to find all permutations of an array with javascript
- responsive grid using antd
- jquery chek radio
- javascript sort alphabetically
- get latest file from s3 bucket javascript
- js check if function is a constructor
- how to check if window size of browser s changed javascript
- json-server localhost
- hook access loopback
- to capital case javascript
- c# get json object from the immediate window?
- asking questions javascript in console
- simple counter react
- js escape url parameter
- nvm show available versions
- reflection of an graph javascript
- how to add multiple event listener in javascript
- how to use flatlist keyextractor
- add webpack to react project tutorial
- how to get the square root in js
- push javascript
- checking object is empty in JS
- js string template decimals
- docker node placement constraints