Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

formater

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

formater

date formater

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

formater

简单的日期格式转化,通过正则的特殊判断,兼容大小写。

how to use

step 1

  • npm install -g cnpm --registry=https://registry.npm.taobao.org

  • cnpm install formater --save

  • 或者使用 yarn add formater

step 2

最好在全局下引用
import 'formater';

  • use
new Date().formater('yyyy-mm-dd hh:mm:ss');
2018-11-12 14:26:52

new Date().formater('yyyy年mm月dd日 hh时mm分ss秒');
2018年11月12日 14时26分52秒

目前仅支持年、月、日、时、分、秒,
季度与毫秒暂不支持

有什么好的想法,欢迎一起成长交流
WeChat:mrliaojun

github

Jared

Keywords

FAQs

Package last updated on 09 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc