npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@stephenhebert/datetime-iso8601

v1.0.0

Published

A small library to simplify parsing and timezone conversion of computer date formats

Readme

datetime-iso8601

A lightweight TypeScript library for parsing, manipulating, and formatting ISO8601 date-time strings with time zone support.

Features

  • Parse ISO8601 date-time strings
  • Manipulate date and time components
  • Convert between time zones (IANA and UTC offset)
  • Format date-time as ISO8601 strings
  • Extract individual date/time components (e.g., weekday)

Installation

npm install @stephenhebert/datetime-iso8601

Usage

import { DateTimeIso8601 } from '@stephenhebert/datetime-iso8601'

const dt = new DateTimeIso8601('2024-06-01T12:34:56+00:00')

// Get all components
console.log(dt.get())

// Get a specific component
console.log(dt.get('year')) // 2024

// Convert to a different time zone
dt.tz('-05:00')
console.log(dt.toString()) // e.g. "2024-06-01T07:34:56-05:00"

// Update components
dt.update({ hour: 15, minute: 0 })
console.log(dt.toString()) // "2024-06-01T15:00:56-05:00"

API

class DateTimeIso8601

constructor(isoString: string)

Creates a new instance from an ISO8601 string.

get(key?: string)

Returns all parsed components or a specific component.

  • year, month, day, hour, minute, second, tzOffsetHour, tzOffsetMinute, date, time, tzOffset, weekday, weekdayIndex

tz(tzOffset: string): this

Converts the date-time to the specified time zone offset (e.g., '+00:00', '-05:00').

update(newComponents: Partial<DateTimeComponents>, relative = false): this

Updates date-time components. If relative is true, adds values to current components.

toString(): string

Returns the ISO8601 string representation.

License

MIT