Skip to content

Takes epoch and gives you YYYY, MM, DD, etc type attributes useful for string formatting

License

Notifications You must be signed in to change notification settings

zibasec/abbreviate-epoch-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

abbreviate-epoch-js

Takes epoch and gives you YYYY, MM, DD, etc type attributes useful for string formatting

Install

npm install zibasec/abbreviate-epoch-js

Usage

const abvEpoch = require('@zibasec/abbreviate-epoch')

const epoch = 1581053541649

const output = epochAbv(epoch)
// value of 'output'
// {
//     YYYY: '2020',
//     MM: '02',
//     DD: '07',
//     hh: '05',
//     mm: '32',
//     ss: '21',
//     ms: '649'
//   }

By default it uses getUTC* methods, to dictate otherwise do this:

const abvEpoch = require('@zibasec/abbreviate-epoch')

const epoch = 1581053541649

const output = epochAbv(epoch, { utc: false })

About

Takes epoch and gives you YYYY, MM, DD, etc type attributes useful for string formatting

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •