javasctipt unix stempel dari tanggal
Math.round(new Date().getTime() / 1000).toString()
Busy Bee
Math.round(new Date().getTime() / 1000).toString()
const unixTime = 1210981217;
const date = new Date(unixTime*1000);
console.log(date.toLocaleDateString("en-US"));
//expected: "5/16/2008"
new Date('2012.08.10').getTime() / 1000
new Date('2012.08.10').getTime() / 1000 //secs
new Date('2012.08.10').getTime() //milliseconds
const unixToDate = (string) => {
const unixTime = string;
const date = new Date(unixTime * 1000);
const newText = date.toLocaleDateString("en-US");
return newText
};
var unixTimestamp = moment('2012.08.10', 'YYYY.MM.DD').unix();