pipr.tools
Pipes
Clean Email Strip formatting from pasted email for clean plain text Clean AI Output Clean plain text from ChatGPT or AI output Decode & Format JWT Decode a JWT and pretty-print header and payload Word Frequency Count word frequency in text

human-to-epoch Convert date string to Unix timestamp

◷ Time
Input0 chars
Output0 chars

Examples

Convert an ISO date to Unix timestamp

Usage
"2025-06-15T14:30:00Z" | human-to-epoch

Convert a project deadline date to epoch for an API call

Usage
"December 31, 2025" | human-to-epoch

Convert event start dates to epoch for comparison

Usage
"2025-01-01T00:00:00Z" | human-to-epoch
View source
(input)=>{
                const d = new Date(input.trim());
                if (isNaN(d.getTime())) return "Error: could not parse date";
                return `Seconds:      ${Math.floor(d.getTime() / 1000)}\nMilliseconds: ${d.getTime()}`;
            }

Related Tools