# sugar-unix

> Unix timestamps for sugar.

Latest version **0.0.0** (published 2013-04-10) · zlib license · 0 weekly downloads

## Install

```sh
npm install sugar-unix
pnpm add sugar-unix
yarn add sugar-unix
bun add sugar-unix
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.0 |
| Published | 2013-04-10 |
| First published | 2013-04-10 |
| Weekly downloads | 0 |
| License | zlib |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Kevin Cox |
| Maintainers | kevincox |
| Keywords | sugar, time, date, timestamp, unix |

## Links

- npm: https://www.npmjs.com/package/sugar-unix
- Repository: https://github.com/kevincox/sugar-unix
- npm.io page: https://npm.io/package/sugar-unix

## Alternatives

- [@js-joda/timezone](https://npm.io/package/@js-joda/timezone.md) — 383.4K weekly downloads
- [chartjs-adapter-moment](https://npm.io/package/chartjs-adapter-moment.md) — 210.8K weekly downloads
- [strftime](https://npm.io/package/strftime.md) — 171.2K weekly downloads
- [vue-flatpickr-component](https://npm.io/package/vue-flatpickr-component.md) — 115.8K weekly downloads
- [timepicker](https://npm.io/package/timepicker.md) — 51.0K weekly downloads

## Recent versions

- 0.0.0 (latest) — 2013-04-10

## README

# sugar-unix

Methods for dealing with unix timestamps with Sugar.  For some reason javascript
returns timestamps as milliseconds rather than seconds.

## Usage

```js
// Statically, get the current time.
Date.unix() === (Date.now()/1000).round() === <the current time as a number>

// Call it on any date object.
(new Date()).unix()

// Parse too!
Date.fromUnix(1234567890)

///// BE CAREFUL /////
new Date(1234567890) != Date.fromUnix(1234567890)
// Because the date constructor uses milliseconds since the epoch.
```

---
_Source: https://npm.io/package/sugar-unix · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
