1.0.5 • Published 1 year ago

time-format-locale v1.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

time-format-locale

本地格式化时间

安装依赖

# install dependencies
npm install time-format-locale --save
# or with yarn
yarn add time-format-locale

方法使用说明

getTimeFormat(value, type, includeETC)

value: 需要本地化的时间;
type:返回的时间格式
  LT:8:30 PM
  LTS:8:30:25 PM
  L:09/04/1986
  I:9/4/1986
  LL:September 4, 1986
  II:Sep 4, 1986
  LLL:September 4, 1986 8:30 PM
  III:Sep 4, 1986 8:30 PM
  LLLL:Thursday, September 4, 1986 8:30 PM
  IIII:Thu, Sep 4, 1986 8:30 PM
  Date:September 4, 1986 8:30:25 PM
includeETC(true/false):是否显示时区,默认显示
import { getTimeFormat } from 'time-format-locale';

let currentLocalTime = getTimeFormat('2022-10-09','LLL'); // September 4, 1986 8:30 PM GMT+08
1.0.5

1 year ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago