time-format-locale
v1.0.5
Published
time locale format
Downloads
40
Readme
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