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

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 :: hex to rgb function 
Javascript :: mongodb group by several fields 
Javascript :: input radio trigger select jquery 
Javascript :: react native navigation navigate 
Javascript :: how to pass data between components in react 
Javascript :: javascript regex cheat sheet 
Javascript :: javascript format date time 
Javascript :: how to remove an object from array in react native 
Javascript :: string to object 
Javascript :: javascript json append array 
Javascript :: json limit express 
Javascript :: jquery display modal bs4 
Javascript :: placeholder in angular 9 select 
Javascript :: javascript declare a variable 
Javascript :: document.getElementById(...).getContext is not a function 
Javascript :: execute bash program using js 
Javascript :: react native environment variables 
Javascript :: js click on button 
Javascript :: currying in javascript 
Javascript :: time js code 
Javascript :: check css property jquery 
Javascript :: moment js get date 1 month 
Javascript :: settimeout js for loop 
Javascript :: javascript initialize array 
Javascript :: js localstorage add text 
Javascript :: timeout httppost angular 
Javascript :: nest navigation react navigation 
Javascript :: local database with javascript 
Javascript :: round number at 2 decimal places 
Javascript :: concat js mdn 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =