pipr.tools

epoch-to-human

Convert Unix timestamp to human-readable date

◷ Time

Try it

stdin0 chars
stdout0 chars

Example

Convert a Unix timestamp to readable date

Usage
$ echo "1700000000" | epoch-to-human
View source
(input) => {
      const ts = parseInt(input.trim());
      if (isNaN(ts)) return "Error: provide a numeric Unix timestamp";
      const d = new Date(ts > 1e12 ? ts : ts * 1000);
      return `ISO:   ${d.toISOString()}\nUTC:   ${d.toUTCString()}\nLocal: ${d.toLocaleString()}`;
    }

Suggested Pipelines

Related Tools