pipr.tools

human-to-epoch

Convert date string to Unix timestamp

◷ Time

Try it

stdin0 chars
stdout0 chars

Example

Convert an ISO date to Unix timestamp

Usage
$ echo "2025-06-15T14:30: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()}`;
    }

Suggested Pipelines

Related Tools