0.4.1 • Published 1 year ago

ctimejs v0.4.1

Weekly downloads
181
License
MIT
Repository
-
Last release
1 year ago

ctime

A light library that provides a minimal function set to manipulate dates and timestamps in Javascript.

  • gzip size
  • unix-timestamp ✅
  • unix-timestamp+ms ✅
  • fluent interface ✅
  • immutable ✅

Install via npm

$ npm install ctimejs

API

ctime().add(30, 'days').subtract(1, 'year').format((time) => time.utc)
  • ctime
    • time ✅
    • unix ✅
    • set ✅
    • get ✅
    • add ✅
    • subtract ✅
    • diff ✅
    • format ✅
    • startOf ✅
    • endOf ✅
    • parser 🔜

Supported ISO8601 Formats

2008-08-30T01:45:36
2018-03-05T01:45:36Z
2018-03-05T01:45:36.999
2018-03-05T01:45:36.999Z
2018-03-05T01:45:36.999+0100
2018-03-05T01:45:36.999+07:00
2018-03-05T03:08:02.177+0100

ctime?

The name was inspired by the C Programming Language function ctime. C code is known for being fast and efficient but also for its dangerous sides, which suits the handling of date objects in JS in my opinion.

made with 💙 in cologne.

0.4.1

1 year ago

0.4.0

1 year ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago