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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@moncici/date-time-processor

v1.0.4

Published

date util

Downloads

15

Readme

Time Zone Formatter

This module provides a simple utility function to format timestamps into a string representation for different time zones. It's designed to be easy to use for displaying dates and times in the user's local time zone or any specified time zone from around the world.

Features

  • Convert timestamps to a formatted string in various time zones.
  • Supports a wide range of time zones.
  • Easy to integrate into any JavaScript project.

Installation

You can include this module in your project by copying the formatTimestamp function into your codebase. There is no need for npm installation as this is a standalone function.

Usage

To use the formatTimestamp function, simply import it into your JavaScript file and call it with the desired timestamp and time zone.

Parameters

  • timestamp (required): The timestamp you want to format. This should be in milliseconds.
  • timeZone (optional): The IANA time zone identifier string of the desired time zone. Defaults to 'Asia/Shanghai' if not specified.

Example

import { formatTimestamp } from './path/to/timeZoneFormatter';

const myTimestamp = Date.now(); // or any timestamp in milliseconds
const timeZone = 'America/New_York';

const formattedDate = formatTimestamp(myTimestamp, timeZone);
console.log(formattedDate); // Outputs the formatted date and time in the specified time zone

Supported Time Zones

This function supports a variety of time zones, including but not limited to:

  • UTC
  • Europe/London
  • Europe/Berlin
  • Africa/Cairo
  • Asia/Beirut
  • Asia/Dubai
  • Asia/Karachi
  • Asia/Kolkata
  • Asia/Jakarta
  • Asia/Shanghai
  • Asia/Tokyo
  • Australia/Sydney
  • Pacific/Auckland
  • America/Anchorage
  • America/Los_Angeles
  • America/Denver
  • America/Chicago
  • America/New_York
  • America/Caracas
  • America/Sao_Paulo

For a complete list of supported time zones, refer to the TIME_ZONES array in the source code.

License

This project is open-sourced under the MIT License. See the LICENSE file for more details.

Contributing

Contributions to improve the function or extend the list of supported time zones are welcome. Please feel free to submit a pull request or open an issue.


This README provides a basic overview of the Time Zone Formatter module, including how to use it and the features it offers. Adjust the path in the import statement according to your project structure.