Overview
What Unix Timestamp to Date does
Validates numeric input, automatically distinguishes common second and millisecond timestamps, and returns a stable ISO-style UTC result.
| Category | Developer Tools |
|---|---|
| Action type | JavaScript |
| Result | Copy the result |
| Internet | Not required |
Example
Action and outcome
| Action | Outcome |
|---|---|
| Unix Timestamp to DateSelected text: 1535438729 | 2018-08-28 06:45:29 UTC |
Workflow
Use Unix Timestamp to Date
Follow these steps to convert Unix seconds or milliseconds to a UTC date with ActionClip.
- Select the text you want to use.
- Choose Unix Timestamp to Date from ActionClip.
- Review the result, then copy it where you need it.
Before you add 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.
Inspect before installing
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");
}