项目作者: PropicSignifi

项目描述 :
Parse, manipulate and display dates and times in Apex
高级语言: Apex
项目地址: git://github.com/PropicSignifi/Moment.apex.git
创建时间: 2018-05-04T01:40:54Z
项目社区:https://github.com/PropicSignifi/Moment.apex

开源协议:MIT License

下载


Moment.apex

Moment.apex parses, manipulates and displays dates and times in Apex.

Examples

Parse Dates

  1. new Moment('2018/01/18', 'yyyy/MM/dd'); // 2018-01-18 00:00:00
  2. new Moment('2018/01/18 14:20:00', 'yyyy/MM/dd HH:mm:ss'); // 2018-01-18 14:20:00

Format Dates

  1. new Moment().format('yyyy/MM/dd'); // 2018/05/04

Manipulate

  1. new Moment().add(1, 'month').subtract(3, 'days'); // 2018-06-01 11:25:37
  2. new Moment().year(2018).month(3).day(1).hour(12).minute(0).second(0); // 2018-03-01 12:00:00
  3. new Moment().year(); // 2018

Relative Time

  1. new Moment().add(3, 'days').fromNow(); // in 3 days