1.2k questions

1.4k answers

361 comments

339 users

Categories

Sidebar
0 votes
662 views
by jon-t-7005 (8.2k points)
I have a UNIX epoch date, such as 1650550779577, and I want to convert that to a human-readable format.  How can this be accomplished?

1 Answer

0 votes
To convert from epoch to something human readable, you can use the Javascript Date function, like this:

var convertedDate = new Date('1650550779577' * 1000);

If you output the convertedDate variable, you'll get something like this: Fri Nov 14 54273 15:39:37 GMT-0800 (PST)

You can then use qie.formatDate() to change it to whatever format you want, like this:

var formattedDate = qie.formatDate('yyyy-MM-dd HH:mm', convertedDate);
by jon-t-7005 (8.2k points)
...