Answers for "why in the hell does JavaScript - Date getMonth() return 11"

0

why in the hell does JavaScript - Date getMonth() return 11

npm install --save proposal-temporal

// temporal-test.js
const { Temporal } = require('proposal-temporal');

// or as an ES module
// import { Temporal } from 'proposal-temporal/lib/index.mjs';

// 11 means November now!
const date = new Temporal.PlainDate(2020, 11, 26); // => 2020-11-26

const sameDate = Temporal.PlainDate.from(
                {year: 2020, month: 11, day: 26}); // => 2020-11-26
Posted by: Guest on September-16-2021

Code answers related to "why in the hell does JavaScript - Date getMonth() return 11"

Code answers related to "Javascript"

Browse Popular Code Answers by Language