Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

dateTime to date in js

let dateStr =new Date("Wed Aug 05 18:11:48 UTC 2020")

dateStr.toLocaleDateString()
// "05/08/2020"

dateStr.toTimeString()
// "23:41:48 GMT+0530 (India Standard Time)"
Comment

convert date time to date function javascript

var date = new Date();
var readable_date = date.toDateString();
console.log(readable_date);

// Tue Jun 09 2020
Comment

datetime to date javascript

var currentDate = new Date();

var date = currentDate.getDate();
var month = currentDate.getMonth(); //Be careful! January is 0 not 1
var year = currentDate.getFullYear();

var dateString = date + "-" +(month + 1) + "-" + year;
Comment

PREVIOUS NEXT
Code Example
Javascript :: json-server 
Javascript :: javascript line break 
Javascript :: javascript regex escape forward slash 
Javascript :: multiple connections to mongoose 
Javascript :: clear canvas 
Javascript :: select tag onchange 
Javascript :: datatable after loading function 
Javascript :: Javascript prime number check 
Javascript :: node js get ip 
Javascript :: document get element by id style 
Javascript :: react media query hook 
Javascript :: fs.readdir example 
Javascript :: regex match entire words only js 
Javascript :: drupal 8 get node from path alias 
Javascript :: image not showing js 
Javascript :: send data through routes in react 
Javascript :: VM724:1 Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0 
Javascript :: how to get relative postiion mouse click on element 
Javascript :: how to get last element of array 
Javascript :: discordjs delete all messages in channel 
Javascript :: how to show only few first elements of array js 
Javascript :: loopback model properties default 
Javascript :: react native how to delete android build 
Javascript :: js string check case 
Javascript :: fillstyle 
Javascript :: rgb to hex js 
Javascript :: iffi in js 
Javascript :: lodash deep clone object 
Javascript :: javascript format seconds into minutes and second 
Javascript :: bootstrap carousel click event next previous 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =