An open API service indexing awesome lists of open source software.

https://github.com/nathanhoad/react-timestamp

A React component for displaying a UTC datetime in the local timezone
https://github.com/nathanhoad/react-timestamp

datetime react timestamp

Last synced: 5 months ago
JSON representation

A React component for displaying a UTC datetime in the local timezone

Awesome Lists containing this project

README

          

# React Timestamp

Render a nice looking time.

## Usage

If you only provide a date then it will just format it nicely:

```jsx
// 26 Mar 2018, 10:30am
```

If you enable `relative` then you'll get something like:

```jsx
// 4 hours ago
// in 4 hours
// 4 hours
// 2 years

// 1 minute ago, 2 minutes ago, 3 minutes ago
```

Other options are set by passing an `options` prop:

```jsx
// Tuesday, 26 Mar 2018, 16:30
```

## Authors

- Nathan Hoad - [nathan@nathanhoad.net](mailto:nathan@nathanhoad.net)