@brentburgoyne/timezone

中文文档
1.0.24发布于 2019/10/23MIT零依赖近 30 天下载 2016

Small, elegant, Olson educated, timezone aware date math and strftime date formatting in pure JavaScript with no dependendcies for Node.js and the browser. Timezone uses the Olson/IANA timezone database. Timezone is aware of every clock transition in th

原始使用文档

Sundial

Timezone Build Status

Format time in JavaScript using the IANA time zone database. (Photo: Sundial by Wolfgang Staudt.)

var tz = require('timezone/loaded'),
    equal = require('assert').equal,
    utc;

// Get POSIX time in UTC.
utc = tz('2012-01-01');

// Convert UTC time to local time in a localize language.
equal(tz(utc, '%c', 'fr_FR', 'America/Montreal'),
      'sam. 31 déc. 2011 19:00:00 EST');

A full-featured time zone aware date formatter for JavaScript.

  • Timezone is a MicroJS library in pure JavaScript with no dependencies that provides timezone aware date math and date formatting.
  • Timezone uses the IANA Database to determine the correct wall clock time anywhere in the world for any time since the dawn of standardized time.
  • Timezone formats dates with a full implementation of strftime formats, including the GNU date extensions.
  • Timezone represents time in POSIX time and local time using RFC 3999 date strings.
  • Timezone is a full featured standards based time library in pure JavaScript for under 3K minified and gzipped.

Hacking

$ git clone --quiet https://github.com/bigeasy/timezone.git
$ cd timezone && make && npm install && npm test

License

The MIT License.

版本与发布记录

@brentburgoyne/timezone 共发布 2 个版本,首次发布于 2019/10/23;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.0.24latest2019/10/237 年前
1.0.232019/10/237 年前

关于 @brentburgoyne/timezone 的常见问题

@brentburgoyne/timezone 是什么?

Small, elegant, Olson educated, timezone aware date math and strftime date formatting in pure JavaScript with no dependendcies for Node.js and the browser. Timezone uses the Olson/IANA timezone database. Timezone is aware of every clock transition in th

如何安装 @brentburgoyne/timezone?

在项目目录运行 npm install @brentburgoyne/timezone,或使用 pnpm add / yarn add / bun add。

@brentburgoyne/timezone 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/brentburgoyne__timezone 是否存在。

@brentburgoyne/timezone 可以商用吗?

@brentburgoyne/timezone 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@brentburgoyne/timezone 的下载量有多少?

根据 npm 官方下载统计,@brentburgoyne/timezone 在 2026/10/09 – 2026/11/07 这 30 天内被下载 2,016 次,日均约 67 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@brentburgoyne/timezone 还在维护吗?

最新版本 1.0.24 发布于 2019/10/23(7 年前);至今共发布 2 个版本,其中过去 12 个月发布了 0 个;首次发布于 2019/10/23。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。