Languages
[Edit]
EN

Dirask - JavaScript date and time templates and examples for posts creation

3 points
Created by:
christa
480

1. Example array with objects containing dates and equivalent timestamps

// ONLINE-RUNNER:browser;

const myList = new Array();

myList[0] = {};
myList[0]['date'] = '2022-02-04T10:00:00.000Z';
myList[0]['timestamp'] = 1643968800;

myList[1] = {};
myList[1]['date'] = '2022-02-05T10:00:00.000Z';
myList[1]['timestamp'] = 1644055200;

myList[2] = {};
myList[2]['date'] = '2022-02-06T10:00:00.000Z';
myList[2]['timestamp'] = 1644141600;

console.log(JSON.stringify(myList, null, 4));

// Output:
// [
//     { date: '2022-02-04T10:00:00.000Z', timestamp: 1643968800 },
//     { date: '2022-02-05T10:00:00.000Z', timestamp: 1644055200 },
//     { date: '2022-02-06T10:00:00.000Z', timestamp: 1644141600 }
// ]

Alternative titles

  1. Dirask - js datetime templates and examples for posts creation
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Dirask - content writing

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join