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

@vipinnagar8700/react-native-date-format

v1.0.4

Published

A lightweight React Native utility for converting any date format into custom readable formats like DD-MM-YYYY, YY/MM/DD hh:mm:ss A (AM/PM), and more. Simple, fast, and dependency-free date formatter for mobile apps.

Downloads

233

Readme


# 📦 @vipinnagar8700/react-native-date-format

A lightweight and dependency-free **React Native date formatter** that converts dates into clean, readable formats — including **DD-MM-YYYY**, **YY/MM/DD**, **hh:mm:ss**, **AM/PM**, and custom patterns.

Perfect alternative to heavy libraries like `moment.js` or `date-fns` when you only need date formatting.

---

## 🚀 Features

- Lightweight — no dependencies  
- Supports custom date patterns  
- 12-hour & 24-hour mode  
- AM/PM formatting  
- Works in React Native & JavaScript  
- Easy to use

---

## 📥 Installation

```sh
npm install @vipinnagar8700/react-native-date-format

or

yarn add @vipinnagar8700/react-native-date-format

📌 Usage Example

import { formatDate } from "@vipinnagar8700/react-native-date-format";

const now = new Date();

console.log(formatDate(now, "DD-MM-YYYY"));       // Output: 21-11-2025
console.log(formatDate(now, "YYYY/MM/DD"));       // Output: 2025/11/21
console.log(formatDate(now, "DD/MM/YY hh:mm A")); // Output: 21/11/25 07:20 PM
console.log(formatDate(now, "hh:mm:ss A"));       // Output: 07:20:45 PM

📑 Supported Format Tokens

| Token | Meaning | Example | | ------ | --------------------- | ------- | | DD | Day (2-digit) | 07 | | D | Day (1-2 digit) | 7 | | MM | Month (2-digit) | 04 | | M | Month (1-2 digit) | 4 | | YYYY | Full year | 2025 | | YY | Short year | 25 | | hh | Hour (12-hour format) | 08 | | HH | Hour (24-hour format) | 20 | | mm | Minutes | 05 | | ss | Seconds | 09 | | A | AM / PM | PM |


🧪 Example Output

| Format | Output Example | | -------------------- | --------------------- | | DD-MM-YYYY | 21-11-2025 | | YYYY/MM/DD hh:mm A | 2025/11/21 07:20 PM | | HH:mm:ss | 19:25:45 |


📚 Why Use This?

Most formatting libraries are huge (50-200KB). This package is:

  • 🔹 < 3KB
  • 🔹 Zero dependencies
  • 🔹 Made specifically for React Native developers

🛠 Future Roadmap

  • time ago formatting (e.g., 5 min ago, yesterday)
  • 🌍 Locale support
  • 🎯 TypeScript types
  • 📅 Relative calendar support

👨‍💻 Author

Mr. Vipin Nagar


📄 License

MIT — free to use in commercial and personal projects.


⭐ Support the Project

If you like this package, please give it a star on GitHub and rate it on npm 🔥

https://github.com/vipinnagar8700/-vipinnagar-react-native-date-format