Immutable datetime objects that wrap the native Date class. This package is a work in progress.
Usage
import Instant from '@twharmon/instant'
const x = new Instant() // x is immutable
const y = x.plus(5, 'days')
console.log(x.format('MMM, D, YYYY')) // Jan 7, 2021
console.log(y.format('MMM, D, YYYY')) // Jan 12, 2021
const z = new Instant('2021-01-07T11:17:42-00:00')
console.log(z.format('h:mm a')) // 11:17 am (if in GMT time zone)
Formatting
The following outputs are based on 2:08:06.123 am January 7, 2021 CDT (Central Daylight Time).