Is there a way to transform the Epoch time value retrieved from a JSON endpoint into a readable time string format such as "Tue 19 Jan 11:14:07 SGT 2038" without relying on external libraries like moment.js?
var ractive = new Ractive({
el: '#container',
template: '#template',
data: {
lastUpdated: 2147483647
}
});
<script src="http://cdn.ractivejs.org/latest/ractive.js"></script>
<pre>$ date --date='@2147483647'
Tue 19 Jan 11:14:07 SGT 2038
</pre>
<div id='container'></div>
<script id='template' type='text/ractive'>
<h1>Time: {{Date(lastUpdated)}}</h1>
</script>
I am seeking a solution that does not involve using any additional libraries, your assistance is greatly appreciated. Thank you!