Skip to main content

2 posts tagged with "JavaScript"

View All Tags

Why a Unix timestamp shows 1970 in JavaScript

· 2 min read
Charly Abraham
Co-Founder, Phoenix Code

Suppose a log says an event happened at 1735689600. You expect January 1, 2025, but new Date(1735689600) gives you a date in January 1970. That log counts seconds since January 1, 1970 at midnight UTC. JavaScript expects milliseconds when you pass a number to new Date().

There are 1,000 milliseconds in a second. You can check the units in a browser before changing any code.

Why Your HTML Preview Is Missing CSS, Images or JavaScript

· 14 min read
Charly P Abraham
Co-Founder, Phoenix Code

An HTML file can link to CSS, images, and JavaScript without copying those files into it. If a preview is missing styles or images, first check the file paths and the preview permissions. If a button does nothing, check whether scripts are allowed. This guide also helps when CSS is not loading, HTML images are not showing, or JavaScript is not working in HTML.

The examples below use Phoenix HTML Viewer. HTML and CSS written inside the document work by default. Hosted files and JavaScript each need permission in the Viewer. The Viewer reads the HTML file you open; it does not import the files beside it.