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

my-date-package

v1.0.5

Published

A lightweight JavaScript package for formatting dates and date utilities

Readme

React + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

Expanding the ESLint configuration

If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the TS template for information on how to integrate TypeScript and typescript-eslint in your project.

Getting Started

📦 Installation

Install via npm or yarn:

npm install my-date-package
# or
yarn add my-date-package

🚀 Getting Started

Import and use the formatDate function in your project:

import { formatDate } from 'my-date-package';

// Today’s date in full format
formatDate(new Date(), 'LLLL');
// ➤ "Monday, May 12, 2025 10:40 AM"

// Custom format: D-MM-YYYY
formatDate('2025-05-09', 'D-MM-YYYY');
// ➤ "9-05-2025"

// ISO timestamp to readable format
formatDate("2025-04-30T11:31:10.096Z", 'LLLL');
// ➤ "Wednesday, April 30, 2025 5:01 PM"

// Full timestamp
formatDate('2025-05-09', 'D MM YYYY HH:mm:ss');
// ➤ "9 05 2025 05:30:00"

🧩 Supported Format Tokens

| Token | Description | Example | |-------|--------------------------|----------| | YYYY | 4-digit year | 2025 | | YY | 2-digit year | 25 | | MMMM | Full month name | May | | MMM | Short month name | May | | MM | Month with leading zero | 05 | | M | Month (1 or 2 digits) | 5 | | DD | Day with leading zero | 09 | | D | Day (1 or 2 digits) | 9 | | dddd | Full weekday name | Monday | | ddd | Short weekday name | Mon | | HH | Hours (00–23) | 17 | | H | Hours (0–23) | 5 | | hh | Hours (01–12) | 05 | | h | Hours (1–12) | 5 | | mm | Minutes (2 digits) | 07 | | ss | Seconds (2 digits) | 03 | | A | AM/PM | AM | | a | am/pm | am | | Z | Timezone offset (+05:30) | +05:30 | | ZZ | Timezone offset (+0530) | +0530 |


🔁 Predefined Format Aliases

| Alias | Format | |--------|--------------------------------| | LT | h:mm A | | LTS | h:mm:ss A | | L | MM/DD/YYYY | | LL | MMMM D, YYYY | | LLL | MMMM D, YYYY h:mm A | | LLLL | dddd, MMMM D, YYYY h:mm A | | l | M/D/YYYY | | ll | MMM D, YYYY | | lll | MMM D, YYYY h:mm A | | llll | ddd, MMM D, YYYY h:mm A |


🔧 Example in React Component

import React from 'react';
import { formatDate } from 'my-date-package';

const DateOutput = () => {
  return (
    <div>
      <p><strong>Today:</strong> {formatDate(new Date(), 'LLLL')}</p>
      <p><strong>Selected Date:</strong> {formatDate('2025-05-09', 'D-MM-YYYY')}</p>
      <p><strong>Formatted Timestamp:</strong> {formatDate("2025-04-30T11:31:10.096Z", 'LLLL')}</p>
      <p><strong>Full Timestamp:</strong> {formatDate('2025-05-09', 'D MM YYYY HH:mm:ss')}</p>
    </div>
  );
};

export default DateOutput;


# 👤 Author

- **Name:** Isha Thummar  


# 🪪 License

This project is licensed under the **MIT License** — see the [LICENSE](./LICENSE) file for details.