# timeless

> Node and browser library that helps to deal with time in timezone- and/or date- agnostic way

Latest version **0.0.2** (published 2013-09-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install timeless
pnpm add timeless
yarn add timeless
bun add timeless
```

## 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.2 |
| Published | 2013-09-03 |
| First published | 2013-08-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.6 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Alex Indigo |
| Maintainers | alexindigo |
| Keywords | time, parse, util, browser, client, server, ender |

## Links

- npm: https://www.npmjs.com/package/timeless
- Repository: https://github.com/alexindigo/timeless
- Issues: https://github.com/alexindigo/timeless/issues
- npm.io page: https://npm.io/package/timeless

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2013-09-03
- 0.0.1 — 2013-08-28

## README

# Timeless [![Build Status](https://travis-ci.org/alexindigo/timeless.png?branch=master)](https://travis-ci.org/alexindigo/timeless) [![Dependency Status](https://gemnasium.com/alexindigo/timeless.png)](https://gemnasium.com/alexindigo/timeless)

Javascript (Node + Browser) library that helps to deal with time in timezone- and/or date- agnostic way

## Install

### Node
```
$ npm install timeless
```

### Ender
```
$ ender add timeless --use=your_ender_file
```

## Usage

### toMilliseconds
– converts time string to milliseconds

Node:
``` javascript
var time = require('timeless');

time.toMilliseconds('11:23'); // -> 44580000
```

Ender:
``` javascript
$.time.toMilliseconds('12:23:57.123'); // -> 44637123
```

### toTimestamp
– parses date[time] string into timestamp (Assumes UTC, AM)

Node:
``` javascript
var time = require('timeless');

time.toTimestamp('12/31/69'); // -> 3155673600000
```

Ender:
``` javascript
$.time.toTimestamp('8/22/13 12:30'); // -> 1377131400000 (22 Aug 2013 00:30:00 GMT)
```

### getBaseDateTime
– returns midnight time of the specified date (strips time value from the timestamp, assumes UTC)

Node:
``` javascript
var time = require('timeless');

time.getBaseDateTime(1377174600000); // -> 1377129600000 (22 Aug 2013 12:30:00 -> 22 Aug 2013 00:00:00)
```

Ender:
``` javascript
$.time.getBaseDateTime(3155673612345); // -> 3155673600000 (31 Dec 2069 00:00:12 -> 31 Dec 2069 00:00:00)
```

### padLeft
– fills empty digit places with ```0```

Node:
``` javascript
var time = require('timeless');

time.padLeft(1); // -> '01'
```

Ender:
``` javascript
$.time.padLeft(10); // -> '10'
```

## License

Timeless is licensed under the MIT license.

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