Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
csbun committed Dec 23, 2015
1 parent 6704ee0 commit 2dcadbe
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion README.md
Expand Up @@ -24,14 +24,25 @@ bower install silly-datetime --save
## Example

```javascript
var sd = require(silly-datetime);
var sd = require('silly-datetime');
sd.format(new Date(), 'YYYY-MM-DD HH:mm');
// 2015-07-06 15:10

sd.fromNow(+new Date() - 2000);
// a few seconds ago
```

ES2015:

```javascript
import {
format,
fromNow
} from 'silly-datetime';
format(new Date(), 'YYYY-MM-DD HH:mm'); // 2015-07-06 15:10
fromNow(+new Date() - 2000); // a few seconds ago
```

## Usage

### .format(datetime, format)
Expand Down

0 comments on commit 2dcadbe

Please sign in to comment.