human-to-epoch Convert date string to Unix timestamp
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()}`;
}