Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

date to seconds js

var date = new Date("2015-08-25T15:35:58.000Z");
var seconds = date.getTime() / 1000; //1440516958
Comment

javascript seconds to date

let sec = 1628618888939
let time = new Date(sec)
let normalDate = new Date(sec).toLocaleString('en-GB',{timeZone:'UTC'})
time: "Tue Aug 10 2021 21:08:08 GMT+0300 (Eastern European Summer Time)"
normalDate: "10/08/2021, 18:08:08"
Comment

js seconds to time

const secs2Time = (secs) => {
  const hours = Math.floor(secs / 60 / 60).toString().padStart(2, 0)
  return hours + ':' + new Date(secs * 1000).toISOString().substr(14, 5)
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript add event listenner for multiple events 
Javascript :: next day date javascript 
Javascript :: Javascript How to push a key value pair into a nested object array 
Javascript :: Pass Props to a Component Using default parameters in react 
Javascript :: javascript remove object key 
Javascript :: get color from classname 
Javascript :: if clicked anything 
Javascript :: dynamic navigation with subitems 
Javascript :: sequelize array of strings 
Javascript :: typescript/JavaScript time ago from datetime 
Javascript :: array put value in index 
Javascript :: clearing cookie in js 
Javascript :: javascript alert 
Javascript :: nodejs update in mysql 
Javascript :: refresh modal on button click jquery 
Javascript :: how to deep copy an object in javascript 
Javascript :: Get element id by name 
Javascript :: javascript sum of number in object array 
Javascript :: check object in array javascript 
Javascript :: ERROR in ./node_modules/react-icons/all.js 4:0-22 
Javascript :: jsdoc for express routes 
Javascript :: mongoose search in multiple fields 
Javascript :: react bootstrap col not working 
Javascript :: Creating URL Search Parameters From An Array 
Javascript :: html select specify deafult select by js variable 
Javascript :: extend javascript 
Javascript :: JavaScript for loop Display Sum of n Natural Numbers 
Javascript :: how to display image from s3 bucket in react js 
Javascript :: how to print a pdf 
Javascript :: js array 0 to n 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =