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 - Mozilla
In essence, the timezone offset is the offset from UTC time, at the time represented by the Date object and at the location of the host environment. There are two groups of Date methods: one group gets and sets various date components by interpreting the timestamp as a local time, while the other uses UTC.
Discussions

How to convert date to timestamp? - javascript
It should have been in this standard date format YYYY-MM-DD, to use below equation. You may have time along with example: 2020-04-24 16:51:56 or 2020-04-24T16:51:56+05:30. It will work fine but date format should like this YYYY-MM-DD only. var myDate = "2020-04-24"; var timestamp = +new Date(myDate) More on stackoverflow.com
🌐 stackoverflow.com
datetime - How do I get a timestamp in JavaScript? - Stack Overflow
Moment.js can abstract away a lot of the pain in dealing with Javascript Dates. See: http://momentjs.com/docs/#/displaying/unix-timestamp/ ... Do know where event comes from. You need to give a better explanation of the way you resolve it instead of you writing an answer. More on stackoverflow.com
🌐 stackoverflow.com
Converting date format for time evaluation
I believe, you'll need to write a small piece of Javascript to convert the timestamp to epoch time. Couldn't see any other obvious options in the preprocessing available for items. https://www.zabbix.com/documentation/current/en/manual/config/items/preprocessing epochtime chosen because then its super easy to do "Has it been 7 days" maths against it. More on reddit.com
🌐 r/zabbix
3
4
February 2, 2023
Filter by date
I recently did this and just used yyyy-mm-dd as a string and it worked fine! More on reddit.com
🌐 r/Supabase
6
7
February 16, 2023
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Date › parse
Date.parse() - JavaScript | MDN - Mozilla
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 ...
🌐
Codedamn
codedamn.com › news › javascript
How to convert timestamp to date in JavaScript?
November 3, 2022 - Convert a timestamp to a valid date object using moment.js.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Date › now
Date.now() - JavaScript - MDN - Mozilla
// 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" }, 2000); ...
🌐
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.
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
The Unix timestamp is an integer that represents times according to the number of seconds since midnight on the 1st of January, 1970. For example: 20 seconds and 13 minutes past 1 am on the 10th of August 2023 can be written as 1691622800.
🌐
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 - Once installed, we can use its API to format dates in various ways. const moment = require('moment'); const timestamp = 1616608200000; // example timestamp const formattedDate = moment(timestamp).format('dddd, MMMM Do YYYY'); console.log(fo...
🌐
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 - Discover efficient JS date manipulation, from handling timestamps to using DateTime, in this essential guide for developers.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Date › getTime
Date.prototype.getTime() - JavaScript - MDN - Mozilla
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.
🌐
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 - For more complex formatting needs or to handle multiple locales and time zones, you might consider using a library like moment.js or date-fns. These libraries offer extensive functionalities for date and time manipulation, including straightforward Unix timestamp conversions.
🌐
30 Seconds of Code
30secondsofcode.org › home › javascript › date › date to unix timestamp
Convert between a JavaScript Date object and a Unix timestamp - 30 seconds of code
January 7, 2024 - This means that you can convert between Date objects and Unix timestamps by dividing or multiplying by 1000. const toTimestamp = date => Math.floor(date.getTime() / 1000); const fromTimestamp = timestamp => new Date(timestamp * 1000); ...
🌐
Timestamp Converter
timestamp.online › article › how-to-convert-timestamp-to-datetime-in-javascript
How To Convert Timestamp To Date and Time in JavaScript - Code Example
Unlike other languages, JavaScript doesn't have equivalent for function strftime. Javascript however provides multiple functions to present date and time in human readable form.
🌐
Coderwall
coderwall.com › p › rbfl6g › how-to-get-the-correct-unix-timestamp-from-any-date-in-javascript
How to get the correct Unix Timestamp from any Date in JavaScript (Example)
June 26, 2023 - Unfortunately, there's a small ... Date.getTime(): A Unix timestamp is defined as the number of seconds that have elapsed since 00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970....
🌐
Stack Abuse
stackabuse.com › bytes › how-to-convert-a-date-to-timestamp-in-javascript
How to Convert a Date to Timestamp in JavaScript
October 4, 2023 - Note: The getTime() method returns the timestamp in milliseconds. If you need the timestamp in seconds, you can divide the result by 1000. So what if we have a date in string format?
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Date › Date
Date() constructor - JavaScript - MDN - Mozilla
const today = new Date(); const birthday = new Date("December 17, 1995 03:24:00"); // DISCOURAGED: may not work in all runtimes const birthday = new Date("1995-12-17T03:24:00"); // This is standardized and will work reliably const birthday = new Date(1995, 11, 17); // the month is 0-indexed const birthday = new Date(1995, 11, 17, 3, 24, 0); const birthday = new Date(628021800000); // passing epoch timestamp · If the Date() constructor is called with one parameter which is not a Date instance, it will be coerced to a primitive and then checked whether it's a string. For example, new Date(undefined) is different from new Date(): js ·
🌐
JavaScript.info
javascript.info › tutorial › the javascript language › data types
Date and time
The call to Date.parse(str) parses the string in the given format and returns the timestamp (number of milliseconds from 1 Jan 1970 UTC+0).