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 🙏

© 2025 – Pkg Stats / Ryan Hefner

datwo

v0.7.2

Published

Datetime format and compare

Downloads

5

Readme

Datwo

Datwoime format and compare

Table of Content

Installation

npm i datwo

Usage

datwo can override vanilla Date class

Format

ESM

import Date from 'datwo';

console.log(new Date().format('YYYY-MM-DD hh:mm:ss'));
console.log(new Date().format('YY-M-D N h:m:s.CC'));
console.log(new Date().format('YYYY / DDD / sssss / CCC'));

CJS

const Date = require('datwo').default;

console.log(new Date().format('YYYY-MM-DD hh:mm:ss'));
console.log(new Date().format('YY-M-D N h:m:s.CC'));
console.log(new Date().format('YYYY / DDD / sssss / CCC'));
2022-09-25 14:30:00
22-9-25 PM 2:30:0.02
2022 / 267 / 52200 / 023

Format Characters

| Chars | Meaning | Example | | ------- | ------------------------------- | ------------- | | YYYY | 4 digit Year | 2022 | | YY | 2 digit Year | 22 | | MM | 2 digit Month (0#) | 09 | | M | 1-2 digit Month | 9 | | DDD | 3 digit Day (00#) (in year) | 237 | | DD | 2 digit Day (0#) | 07 | | D | 1-2 digit Day | 7 | | hh | 2 digit Hour (0#) | 08 | | h | 1-2 digit Hour | 8 | | hhhh | 2 digit Hour (0#) (in 12 hours) | 08 | | hhh | 1-2 digit Hour (in 12 hours) | 8 | | mm | 2 digit Minute (0#) | 03 | | m | 1-2 digit Minute | 3 | | sssss | 5 digit Second (in day) | 04363 | | ss | 2 digit Second (0#) | 09 | | s | 1-2 digit Second | 9 | | CCC | 3 digit Milisecond (00#) | 123 | | CC | 2 digit Milisecond (0#) | 12 | | C | 1 digit Milisecond | 1 | | T | new Date().getTime() | 1664076951031 | | | | | | N | AM / PM | AM | | NK | 오전 / 오후 | 오전 | | G | Time words of day | Morning | | GK | 시간대를 나타내는 단어 | 아침 |

Compare

console.log(new Date('2022-01-02 00:00:00').compare(new Date('2021-12-29 00:05:00')));
console.log(new Date('2022-01-02 00:00:00').compare(new Date('2022-01-01 00:10:00')));
console.log(new Date('2022-01-02 00:00:00').compare(new Date('2022-01-01 24:53:00')));
console.log(new Date('2022-01-02 00:00:00.000').compare(new Date('2022-01-01 24:59:59.256')));
사흘 전
23시간 전
7분 전
744밀리초 전