china-time

0.12.3 • Public • Published

china time

Nodejs 获取北京时间。 当服务器不在东八区时,可以获取当前东八区的时间。

download version license

install

yarn add china-time

if you prefer npm:

npm i china-time

usage

const chinaTime = require('china-time');
 
console.log(chinaTime()); // 2018-02-07T04:38:00.000Z
console.log(chinaTime().getTime()); // 1517978280000
console.log(chinaTime('YYYY-MM-DD HH:mm:ss')); // 2018-02-07 13:08:17
console.log(chinaTime('YY/MM/DD HH:mm')); // 18/02/07 13:08
console.log(chinaTime('YYYY MM DD')); // 2018 02 07

License

MIT License

Copyright (c) 2017-present, hwen hwenleung@gmail.com

Package Sidebar

Install

npm i china-time

Weekly Downloads

300

Version

0.12.3

License

MIT

Unpacked Size

43 kB

Total Files

9

Last publish

Collaborators

  • hwen