0.0.44 • Published 4 years ago

util.timestamp v0.0.44

Weekly downloads
21
License
MIT
Repository
github
Last release
4 years ago

util.timestamp

Generates a string timestamp

build analysis code style: prettier testing NPM

This module is a thin wrapper on the strftime module to create a simple string timestamp with a consistent format. It uses the format rule:

%Y%m%d%H%M%S%L

This results in a 17 byte string representing the current timestamp. e.g.

20170126075705148

Installation

This module uses yarn to manage dependencies and run scripts for development.

To install as a global package:

$ yarn global add util.timestamp

To install as a development dependency with cli:

$ yarn add --dev util.timestamp

To build the app and run all tests:

$ yarn run all

Usage

There are two ways to use this package:

  • Command line
  • Function call

Command line

The timestamp can be generated from the command line using:

timestamp

This will return the default format above. This could be used in scripting.

Function call

The default JavaScript call will just return the timestamp format above as a string:

const timestamp = require('util.timestamp');
console.log(timestamp());

The function also has an option to set a format that is acceptable to the strftime library:

const timestamp = require('util.timestamp');
console.log(timestamp({
    dateFormat: '%B %d, %Y %H:%M:%S'
}));

// returns the string: 'April 28, 2011 18:21:08'
0.0.44

4 years ago

0.0.43

4 years ago

0.0.42

5 years ago

0.0.41

5 years ago

0.0.40

5 years ago

0.0.39

5 years ago

0.0.38

5 years ago

0.0.37

6 years ago

0.0.36

6 years ago

0.0.35

6 years ago

0.0.34

6 years ago

0.0.33

6 years ago

0.0.32

7 years ago

0.0.31

7 years ago

0.0.30

7 years ago

0.0.29

7 years ago

0.0.28

7 years ago

0.0.27

7 years ago

0.0.26

7 years ago

0.0.24

7 years ago

0.0.23

7 years ago

0.0.22

7 years ago

0.0.21

7 years ago

0.0.20

7 years ago

0.0.19

7 years ago

0.0.18

7 years ago

0.0.17

7 years ago

0.0.16

7 years ago

0.0.15

7 years ago

0.0.14

7 years ago

0.0.13

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago