The words Under construction in black text on a yellow background with diagonal black stipes surrounding it
I'm in the process of moving my site. It's still a work in progress. Please excuse the mess and broken links.

Convert an ISO Date String Into A Formatted Date In JavaScript

TODO: Pull subtitle into page object

TODO: see new post with toLocaleString()

code_start_default_section code_end_default_section

Debugging Stuff

I'm moving stuff around right now. All this below is helping me figure out where to put stuff

        -- title

Convert an ISO Date String Into A Formatted Date In JavaScript

-- p

TODO: see new post with toLocaleString()

-- code/
-- javascript

#!/usr/bin/env node

const months = [
  'January',
  'February',
  'March',
  'April',
  'May',
  'June',
  'July',
  'August',
  'September',
  'October',
  'November',
  'December',
]

const dateString = '2021-11-12T02:03:03-04:00'
const dateObject = new Date(dateString)

console.log(`${months[dateObject.getMonth()]} ${dateObject.getFullYear()}`)

-- /code

-- p

Produces:

-- code/

November 2021

-- /code

-- p

-- hr

-- code/

#!/usr/bin/env node

const months = [
  'Jan.',
  'Feb.',
  'Mar.',
  'Apr.',
  'May',
  'Jun.',
  'Jul.',
  'Aug.',
  'Sept.',
  'Oct.',
  'Nov.',
  'Dec.',
]

const dateString = '2021-11-12T02:03:03-04:00'
const dateObject = new Date(dateString)

console.log(`${months[dateObject.getMonth()]} ${dateObject.getFullYear()}`)

-- /code


-- categories
-- JavaScript

-- metadata
-- date: 2021-11-13 21:34:05
-- id: 20ti27jt
-- status: scratch
-- type: post
-- SCRUBBED_NEO: false
-- site: aws