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

time-utils-pro

v0.0.2

Published

Time utils

Readme

Sure, here is the README.md file in English. I've enclosed it in a code block for easy copying:

# time-utils-pro

`time-utils-pro` is a JavaScript package for easy manipulation of the current time. It offers functions for getting the current hour, minute, day, month, and year, as well as formatting dates and times according to various patterns.

## Installation

To use this package in your project, install it using npm:

```bash
npm install time-utils-pro

Usage

After installing, you can import and use the package in your JavaScript project. Here’s an example of how to use each function:

Importing the Package

const timeUtils = require('time-utils-pro');
// or, if you're using ES modules
import * as timeUtils from 'time-utils-pro';

Functions

getCurrentDateTime()

Returns the current time as a Date object.

const currentDateTime = timeUtils.getCurrentDateTime();
console.log(currentDateTime); // For example: 2024-07-29T12:34:56.789Z

getHour()

Returns the current hour.

const hour = timeUtils.getHour();
console.log(hour); // For example: 12

getMinute()

Returns the current minute.

const minute = timeUtils.getMinute();
console.log(minute); // For example: 34

getDay()

Returns the current day of the month.

const day = timeUtils.getDay();
console.log(day); // For example: 29

getMonth()

Returns the current month (1-12).

const month = timeUtils.getMonth();
console.log(month); // For example: 7

getYear()

Returns the current year.

const year = timeUtils.getYear();
console.log(year); // For example: 2024

formatDateTime(format)

Formats the date and time according to the given pattern. Supported patterns include:

  • YYYY - Year
  • MM - Month (zero-padded)
  • DD - Day (zero-padded)
  • HH - Hours (zero-padded)
  • mm - Minutes (zero-padded)
  • ss - Seconds (zero-padded)
const formattedDate = timeUtils.formatDateTime('YYYY-MM-DD HH:mm:ss');
console.log(formattedDate); // For example: 2024-07-29 12:34:56

Examples

const timeUtils = require('time-utils-pro');

console.log('Current Hour:', timeUtils.getHour());
console.log('Current Minute:', timeUtils.getMinute());
console.log('Current Day of the Month:', timeUtils.getDay());
console.log('Current Month:', timeUtils.getMonth());
console.log('Current Year:', timeUtils.getYear());
console.log('Formatted Time:', timeUtils.formatDateTime('DD/MM/YYYY HH:mm'));

Contributing

If you would like to contribute to the project, you can submit a pull request or open an issue if you encounter any problems. Please make sure to review existing issues and discuss your proposed changes before adding new features or fixes.

License

This project is licensed under the MIT License.

Contact

For more information or inquiries, please contact me at [email protected].


Thank you for using time-utils-pro! If you have any questions or suggestions, feel free to reach out.