Developer Tools

Unix Timestamp to Date

Convert Unix seconds or milliseconds to a UTC date.

OfficialOn-device

Download action

What Unix Timestamp to Date does

Validates numeric input, automatically distinguishes common second and millisecond timestamps, and returns a stable ISO-style UTC result.

CategoryDeveloper Tools
Action typeJavaScript
ResultCopy the result
InternetNot required

Action and outcome

Unix Timestamp to Date example
ActionOutcome
Unix Timestamp to DateSelected text: 15354387292018-08-28 06:45:29 UTC

Use Unix Timestamp to Date

Follow these steps to convert Unix seconds or milliseconds to a UTC date with ActionClip.

  1. Select the text you want to use.
  2. Choose Unix Timestamp to Date from ActionClip.
  3. Review the result, then copy it where you need it.

Requirements and privacy

  • Before you start: No setup required.
  • Your selected text: Runs locally in ActionClip’s JavaScript sandbox. Selected text does not leave your Mac.

Action configuration

The definition below is included so you can inspect how the action works before downloading it.

JavaScript definition
function run(selected_text) {
  const input = selected_text.trim().replace(/\s+/g, "");
  if (!/^[+-]?\d+(?:\.\d+)?$/.test(input)) {
    throw new Error("Enter a Unix timestamp in seconds or milliseconds.");
  }
  const numeric = Number(input);
  if (!Number.isFinite(numeric)) throw new Error("Timestamp is outside the supported range.");
  const milliseconds = Math.abs(numeric) >= 100000000000 ? numeric : numeric * 1000;
  const date = new Date(milliseconds);
  if (!Number.isFinite(date.getTime())) throw new Error("Timestamp is outside the supported range.");
  return date.toISOString().replace("T", " ").replace(/\.000Z$/, " UTC").replace(/Z$/, " UTC");
}