Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 6, 2024 via pnpm

moment-timezone 0.5.43

Parse and display moments in any timezone.
Package summary
Share
0
issues
1
license
2
MIT
Package created
7 Jul 2013
Version published
31 Mar 2023
Maintainers
7
Total deps
2
Direct deps
1
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
2 Packages, Including:
moment-timezone@0.5.43
moment@2.30.1
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
β“˜ This is a list of moment-timezone 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
moment2.30.1698.76 kBMIT
prod

Visualizations

Frequently Asked Questions

What does moment-timezone do?

Moment-timezone is an npm package that provides IANA time zone support for Moment.js, a popular library for managing dates and times in JavaScript. It's an add-on that allows developers to parse, manipulate, and display moments in any timezone. It is, however, considered a legacy project and is in maintenance mode with most users encouraged to choose a different library.

How do you use moment-timezone?

The usage of Moment-timezone is quite straightforward. It lets you manipulate and display dates and times in JavaScript based on different time zones. Specifically, you would use Moment.js to create a moment object, and then use Moment-timezone to convert and format that moment object into a specific timezone.

An example of usage is as follows:

var moment = require('moment-timezone'); // require the moment-timezone package
var june = moment("2014-06-01T12:00:00Z"); 
june.tz('America/Los_Angeles').format('ha z'); // the output is "5am PDT"

In this example, we first require the moment-timezone library. We then create a moment object for a specific date and time (June 1, 2014, at 12:00:00 UTC). Finally, we use the .tz() method to convert the moment object's time to the "America/Los_Angeles" timezone, and the .format() method to display the time in a specific format ("ha z" gives the hour in 12-hour format and the timezone abbreviation).

Where are the moment-timezone docs?

For comprehensive documentation on Moment-timezone, you can refer to the official documentation provided by Moment.js. It covers everything from basic usage to more advanced topics, along with detailed explanations and code examples to help understand the usage of each method and feature.