# time-man

> A Simple JavaScript Library to Manipulate Time

Latest version **1.0.1** (published 2020-07-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install time-man
pnpm add time-man
yarn add time-man
bun add time-man
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2020-07-06 |
| First published | 2020-07-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 45.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jayesh Waghmare |
| Maintainers | jayesh-w |
| Keywords | Time |

## Links

- npm: https://www.npmjs.com/package/time-man
- Repository: https://github.com/Time-man/time-man
- Homepage: https://github.com/Time-man/time-man#readme
- Issues: https://github.com/Time-man/time-man/issues
- npm.io page: https://npm.io/package/time-man

## 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

- 1.0.1 (latest) — 2020-07-06
- 1.0.0 — 2020-07-06

## README

# Time-man JS
### A Simple JavaScript Library to manage "Time".

----
## Installation
#### 1. NPM

```bash
$npm install time-man
```
and then

```js
const Time = require('time-man');
```

#### 2. Script Tag

```html
<script src="dist/time-man.min.js"></script>

<!-- or -->

<script src="dist/time-man.js"></script>

```

#### 3. CDN

```html
<script src="https://unpkg.com/time-man@1.0.1/dist/time-man.min.js"></script>

<!-- or -->

<script src="https://unpkg.com/time-man@1.0.1/dist/time-man.js"></script>

```


----
## Usage
1. To declare a time object like Date() in JS.
2. Basic add/subtract,average and more handy functions.

----
### Declare a time object

```js

const object = new Time();

//OR

const object = new Time('23:56:00');

// OR

const object = new Time('23:56:00','H:i:s');

//OR

const object = new Time('23:56','H:i');

```

### log the time


```object.logTime()```



----
## Object Methods[object.Method()]

Method | Description
------------ | -------------
string getTime() | Returns a string .
logTime() | Logs the time directly to console.
string addTime([object]) | adds time to current object
string addTime(['00:00:00'],[format])| adds Time to current object
string subTime([object]) | subtracts time from current object
string subTime(['00:00:00'],[format])| subtracts Time from current object
string getFormat() | get the format of time
string getTime_12Hr() | returns 12-Hr format of Time.
string getTimeZone() | returns the Time Zone.

----
## Static Methods [Time.method()]
Method | Description
------------ | -------------
string averageTime([Array of Times) | Returns average of Time.
object TimeSlicer([from time][to time][per Slot time]) | Returns an object of slotted Time.
string UnixTimeStamp() | get the current Unix Time Stamp
string CurrentDate() | get the current Date
string TimeStamp() | get SQL friendly TimeStamp eg 2020-12-12 23:23:23
string TimeZone() | get Current TimeZone(same as getTimeZone)



----
## People
Author [Jayesh Waghmare](https://github.com/jayesh-w)

----
## License
[MIT](LICENSE)

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