1.4.0 • Published 3 years ago

mktimestamp v1.4.0

Weekly downloads
1
License
BSD-3-Clause
Repository
-
Last release
3 years ago

mktimestamp

generates a timestamp from current or provided date/time, utc or local

Why?

Mostly because I need a UTC timestamp, but this package allows conversion of arbitrary timestamps to UTC or, in the simplest case, acts as a configurable proxy to Date.now()

Usage

import { mktimestamp, utcnow, now } from "mktimestamp";

const rightNow = mktimestamp();
const utcNow = mktimestamp({ utc: true });
const utcSomeOtherTime = mktimestamp({ utc: true, timestamp: 1596020185055 });

// alternative invocations
const rightNow2 = mktimestamp("local");
const utcNow2 = mktimestamp("utc");

// convenience functions
const utcNow3 = utcnow();
const rightNow3 = now();

Credits

This project is made easier by:

1.4.0

3 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago