New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

iso-timestamp

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iso-timestamp

Generate ISO 8601 timestamp: YYYYMMDDhhmmssSSS

latest
Source
npmnpm
Version
1.2.0
Version published
Maintainers
1
Created
Source

GitHub License GitHub commit activity GitHub Actions Workflow Status GitHub Release GitHub Release Date GitHub Issues or Pull Requests GitHub watchers GitHub forks GitHub Repo stars NPM Version NPM Type Definitions NPM Downloads Node Current

iso-timestamp

Generate ISO 8601 timestamp: YYYYMMDDhhmmssSSS

Install

npm install iso-timestamp

or

yarn add iso-timestamp

or

pnpm add iso-timestamp

API

timestamp(options?) or timestamp(date, options?)

  • date: Custom date

  • options:

    • excludeTime: Exclude time, i.e. hour, minute and second. Default: false
    • excludeMillisecond: Exclude millisecond from time. Default: false
    • separator: Separator among elements of the timestamp. Default: ''
import timestamp from 'iso-timestamp'
// Or import { timestamp } from 'iso-timestamp'

timestamp()
// return current timestamp: 202408070101123

timestamp({ excludeMillisecond: true })
// return timestamp with millisecond excluded: 202408070101

timestamp({ excludeTime: true })
// return timestamp with time excluded: 20240807

timestamp(new Date('2050-03-04T12:03:04.123'), { excludeMillisecond: true })
// return timestamp with custom Date: 20500304120304

timestamp({ separator: '-', excludeTime: true })
// return timestamp with custom separator: 2024-08-07

Authors

👤 GloryWong

  • Website: https://glorywong.com
  • GitHub: @GloryWong

Show Your Support

Give a ⭐️ if this project helped you!

Keywords

timestamp

FAQs

Package last updated on 26 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts