Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

generate random date

function getRandomDate() {
    const maxDate = Date.now();
    const timestamp = Math.floor(Math.random() * maxDate);
    return new Date(timestamp);
}

console.log(getRandomDate());
Comment

PREVIOUS NEXT
Code Example
Javascript :: regex separator 
Javascript :: getting state in react-router-dom v6 
Javascript :: how to get items in dynamodb nodejs 
Javascript :: mongoose connect to mongodb 
Javascript :: checkvalidity 
Javascript :: javascript change paragraph text 
Javascript :: [Error - 10:52:45 PM] Failed to load jshint library 
Javascript :: predicate function javascript 
Javascript :: string contains javascript 
Javascript :: access variable outside for loop javascript 
Javascript :: pxijs text 
Javascript :: how to close tab by javascript 
Javascript :: node js catch any errors 
Javascript :: js conditional key 
Javascript :: fetch data from asyncstorage react native 
Javascript :: jquery on change 
Javascript :: calculate today date javascript 
Javascript :: js new date short format 
Javascript :: material ui color background 
Javascript :: mongoose unique error message 
Javascript :: read json file into object javascript 
Javascript :: image upload in react js 
Javascript :: nodejs cors policy 
Javascript :: discord.js send message to a given channel 
Javascript :: javascript change input value event 
Javascript :: sort by string react 
Javascript :: google maps js remove google maps logo 
Javascript :: date time js 
Javascript :: reactbootstrap multiselect 
Javascript :: js array return only certain positions 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =