New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

d2ts

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d2ts

Convert date to timestamp

latest
npmnpm
Version
1.0.2
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

d2ts

Convert date to timestamp.

Usage

npx d2ts '2022/11/29 02:01:00'
# => 1669658460000 (TZ=Asia/Shanghai)

# Get current timestamp (no argument)
npx d2ts

Environment Variables

  • TZ or TIMEZONE: Set timezone (default: auto-detected local timezone)

Examples

TZ=America/New_York npx d2ts '2022/11/28 13:01:00'
# => 1669658460000

npx d2ts '2022/11/28 13:01:00 -0500'
# => 1669658460000

npx d2ts '2022-11-28T18:01:00Z'
# => 1669658460000

npx d2ts '2022-11-28'
# => 1669564800000 (assumes time 00:00:00)

License

MIT

Keywords

date

FAQs

Package last updated on 04 Feb 2026

Related posts