https://github.com/segmentio/to-unix-timestamp
Convert a date to a Unix timestamp.
https://github.com/segmentio/to-unix-timestamp
grim-repo-ignore paused
Last synced: 8 months ago
JSON representation
Convert a date to a Unix timestamp.
- Host: GitHub
- URL: https://github.com/segmentio/to-unix-timestamp
- Owner: segmentio
- Created: 2013-09-27T02:37:07.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2023-10-05T18:27:48.000Z (over 2 years ago)
- Last Synced: 2025-09-11T00:16:04.173Z (10 months ago)
- Topics: grim-repo-ignore, paused
- Language: Makefile
- Homepage:
- Size: 31.3 KB
- Stars: 3
- Watchers: 38
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
README
# to-unix-timestamp [![CI][ci-badge]][ci-link]
> **Note**
> Segment has paused maintenance on this project, but may return it to an active status in the future. Issues and pull requests from external contributors are not being considered, although internal contributions may appear from time to time. The project remains available under its open source license for anyone to use.
Convert a date to a Unix timestamp.
## Installation
```sh
$ component install segmentio/to-unix-timestamp
```
## Example
```js
var unix = require('to-unix-timestamp');
unix(new Date()); //=> 1380249249
```
## API
### toUnixTimestamp(date)
Converts a Date object to a Unix timestamp.
## License
MIT
[ci-badge]: https://circleci.com/gh/segmentio/to-unix-timestamp.svg?style=svg
[ci-link]: https://circleci.com/gh/segmentio/to-unix-timestamp