Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

date time js

//Do you need the current time ? ⌚
let date = new Date();
let time = ((date.getHours().toString()).length>1? date.getHours() : "0"+date.getHours()) +":"+ ((date.getMinutes().toString()).length>1? date.getMinutes() : "0"+date.getMinutes());
//If 4h-2min => 04:02
//If 20h-15min => 20:15
Comment

js time function

const t0 = performance.now();
doSomething();
const t1 = performance.now();
console.log(`Call to doSomething took ${t1 - t0} milliseconds.`);
Comment

PREVIOUS NEXT
Code Example
Javascript :: convert an array to uppercase or lowercase js 
Javascript :: javascript sort array descending order 
Javascript :: in text includes in aray of objects 
Javascript :: jqeury input checkbox listener not working 
Javascript :: js get english alphabet 
Javascript :: sort li elements with js 
Javascript :: auto import vscode not working 
Javascript :: firebase auth api key not valid. please pass a valid api key 
Javascript :: javascript how to get subarray 
Javascript :: react router 6 multiple routes layout 
Javascript :: js function 
Javascript :: javjquery is emptyobject 
Javascript :: jquery add option if not exist 
Javascript :: angular return observable with error 
Javascript :: jquery find tag and class 
Javascript :: javascript hypot 
Javascript :: moment.js 
Javascript :: react app 
Javascript :: connect ECONNREFUSED 127.0.0.1:80 nuxt config 
Javascript :: how to draw a horizontal line in javascript 
Javascript :: javascript on selected 
Javascript :: vue loop 
Javascript :: react onclick runs on load 
Javascript :: export default react 
Javascript :: nested for loop js 
Javascript :: short if statements in javascript 
Javascript :: if browsertab is active jquery 
Javascript :: ordering array 
Javascript :: js hoisting 
Javascript :: for of loop 
ADD CONTENT
Topic
Content
Source link
Name
7+7 =