let unix_timestamp = 1549312452;

// Create a new JavaScript Date object based on the timestamp
// multiplied by 1000 so that the argument is in milliseconds, not seconds
var date = new Date(unix_timestamp * 1000);

// Hours part from the timestamp
var hours = date.getHours();

// Minutes part from the timestamp
var minutes = "0" + date.getMinutes();

// Seconds part from the timestamp
var seconds = "0" + date.getSeconds();

// Will display time in 10:30:23 format
var formattedTime = hours + ':' + minutes.substr(-2) + ':' + seconds.substr(-2);

console.log(formattedTime);

For more information regarding the Date object, please refer to MDN or the ECMAScript 5 specification.

Answer from Aron Rotteveel on Stack Overflow
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Date
Date - JavaScript | MDN
A JavaScript date is fundamentally specified as the time in milliseconds that has elapsed since the epoch, which is defined as the midnight at the beginning of January 1, 1970, UTC (equivalent to the UNIX epoch). This timestamp is timezone-agnostic and uniquely defines an instant in history.
Discussions

javascript - How to convert date to timestamp? - Stack Overflow
3 Convert date time to integer timestamp in javascript More on stackoverflow.com
🌐 stackoverflow.com
How to REALLY get a UTC Date object

var date = new Date('2015-10-11T14:03:19.243Z'); var str = date.toISOString();

More on reddit.com
🌐 r/javascript
6
1
February 8, 2014
How to get timestamp from firestore in react-native
Use the toDate() method provided by firebase to convert firebase timestamps to JavaScript Date Objects More on reddit.com
🌐 r/reactnative
11
10
December 26, 2019
any way to include timestamps in logs?
Help > Options More on reddit.com
🌐 r/Bitburner
9
7
December 29, 2021
🌐
CoreUI
coreui.io › answers › how-to-convert-a-timestamp-to-a-date-in-javascript
How to convert a timestamp to a date in JavaScript · CoreUI
October 2, 2025 - Convert a timestamp to a date in JavaScript using new Date() constructor with timestamp parameter for accurate date object creation.
🌐
Codedamn
codedamn.com › news › javascript
How to convert timestamp to date in JavaScript?
November 3, 2022 - We will utilize the moment.unix() method to do this. It takes a timestamp as an argument and outputs a date object.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Date › parse
Date.parse() - JavaScript | MDN
The Date.parse() static method parses a string representation of a date, and returns the date's timestamp. // Standard date-time string format const unixTimeZero = Date.parse("1970-01-01T00:00:00Z"); // Non-standard format resembling toUTCString() const javaScriptRelease = Date.parse("04 Dec ...
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-convert-a-date-string-to-timestamp-in-javascript
How to Convert a Date String to Timestamp in JavaScript ? - GeeksforGeeks
July 23, 2025 - In this article, we are going to learn about the conversion of Date strings to Timestamps by using JavaScript.
Find elsewhere
🌐
Sentry
sentry.io › sentry answers › javascript › convert unix timestamp to date and time in javascript
Convert Unix timestamp to date and time in JavaScript | Sentry
Therefore, to use a Unix timestamp, we must multiply it by 1000. const myUnixTimestamp = 1691622800; // start with a Unix timestamp const myDate = new Date(myUnixTimestamp * 1000); // convert timestamp to milliseconds and construct Date object ...
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-convert-unix-timestamp-to-time-in-javascript
How to convert Unix timestamp to time in JavaScript ? - GeeksforGeeks
July 12, 2025 - ... As JavaScript works in milliseconds, it is necessary to convert the time into milliseconds by multiplying it by 1000 before converting it. This value is then given to the Date() function to create a new Date object.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Date › getTime
Date.prototype.getTime() - JavaScript | MDN
const moonLanding = new Date("July 20, 69 20:17:40 GMT+00:00"); // Milliseconds since Jan 1, 1970, 00:00:00.000 GMT console.log(moonLanding.getTime()); // Expected output: -14182940000 ... A number representing the timestamp, in milliseconds, of this date.
🌐
Toptal
toptal.com › developers › software › definitive-guide-to-datetime-manipulation
How to get the Timestamp And Date in Javascript: JS DateTime | Toptal®
December 2, 2020 - This makes JavaScript date-from-timestamp and JavaScript timestamp-to-date conversion straightforward, provided the UTC time zone is used.
🌐
InfluxData
influxdata.com › home › how to get, convert & format javascript date from timestamp | influxdata
How to Get, Convert & Format JavaScript Date From Timestamp | InfluxData
February 10, 2023 - If you’re working with timestamps ... UTC. To convert a Unix timestamp to a JavaScript timestamp, we can multiply it by 1,000 to convert it to milliseconds....
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Date › now
Date.now() - JavaScript | MDN
// This example takes 2 seconds to run const start = Date.now(); console.log("starting timer..."); // Expected output: "starting timer..." setTimeout(() => { const ms = Date.now() - start; console.log(`seconds elapsed = ${Math.floor(ms / 1000)}`); // Expected output: "seconds elapsed = 2" }, ...
🌐
Plain English
plainenglish.io › home › blog › javascript › how to convert a date string to timestamp in javascript?
How to Convert a Date String to Timestamp in JavaScript?
April 19, 2022 - The unix() method returns the timestamp in seconds so we don't have to divide the returned result by 1000. We can use plain JavaScript or Moment.js to convert a date string into a UNIX timestamp.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Date › Date
Date() constructor - JavaScript | MDN
An integer value representing the timestamp (the number of milliseconds since midnight at the beginning of January 1, 1970, UTC — a.k.a. the epoch). ... A string value representing a date, parsed and interpreted using the same algorithm implemented by Date.parse(). See date time string format for caveats on using different formats. ... An existing Date object. This effectively makes a copy of the existing Date object with the same date and time. This is equivalent to new Date(dateObject.valueOf()), except the valueOf() method is not called.
🌐
W3Schools
w3schools.com › jsref › jsref_obj_date.asp
JavaScript Date Reference
altKey (Mouse) altKey (Key) animationName bubbles button buttons cancelable charCode clientX clientY code ctrlKey (Mouse) ctrlKey (Key) currentTarget data defaultPrevented deltaX deltaY deltaZ deltaMode detail elapsedTime elapsedTime eventPhase inputType isTrusted key keyCode location metaKey (Mouse) metaKey (Key) newURL oldURL offsetX offsetY pageX pageY persisted propertyName relatedTarget relatedTarget screenX screenY shiftKey (Mouse) shiftKey (Key) target targetTouches timeStamp touches type which (Mouse) which (Key) view HTML Event Methods
🌐
Zipy
zipy.ai › blog › convert-unix-timestamp-to-date-and-time-in-javascript
convert unix timestamp to date and time in javascript
April 12, 2024 - To convert a Unix timestamp to a date and time, you can use the Date constructor, passing the timestamp multiplied by 1000 (to convert seconds to milliseconds, as JavaScript deals with time in milliseconds).
🌐
Nesin
nesin.io › blog › javascript-date-to-unix-timestamp
How to convert Date to Unix Timestamp in Javascript
April 2, 2023 - In Javascript, Date object has getTime() method and it returns number of milliseconds since the Unix epoch which is January 1, 1970 00:00:00 UTC · And unix timestamp are mostly represented in seconds not milliseconds and so we'll be converting ...
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Date › UTC
Date.UTC() - JavaScript | MDN
Integer value representing the millisecond segment of a time. Defaults to 0. A number representing the timestamp of the given date.