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

oq-time-zone

v1.0.1

Published

Pretty time zone: `+2` or `-9:30`.优化时区

Downloads

36

Readme

oq-time-zone

Pretty time zone: +2 or -9:30.优化时区

INSTALL

$ npm install --save oq-time-zone

USAGE

var timeZone = require('oq-time-zone');

// current time zone (in Norway)
// 挪威非夏令时时区(当前时间为12月,为非夏令时,不受影响)
timeZone();
//=> '+1'

// time zone in May (in Norway)
// 挪威五月份时区,受夏令时影响,时区会发生变化
timeZone(new Date(2016, 5, 1));
//=> '+2'

// current time zone (in French Polynesia)
// 法属波利尼西亚的时区,不是整时,还有很多地区的时区也不是整时
timeZone();
//=> '-9:30'

API

timeZone([date])

date 可选参数,Date对象

Type: Date Default: new Date()

Custom date.自定义Date对象,一般在时区会随着时间有变动的地区有用

返回值(字符串)

  • 本地时间领先于UTC时间,返回”+“
  • 本地时间落后于UTC时间,返回"_"
  • 零区时区为‘0’
  • 有些地区因夏令时、地理、历史原因,时区不是整数,返回"-9:30"、“+4:30”等形式

想了解更多时区问题,参见convertworld

License

MIT

AUTHORS

This project belongs to OpenQuest---A open organization concentrates on reading excellent codes from npm.org and github.com and commenting them so that everyone can understand easily. You can check the index_comment.js to get the source comments. For more information, linking to https://github.com/OpenQuest.