Guides

A web developer's toolbox: timestamps, cron, permissions and headers

Some details come up so often in web work that nobody memorizes them: whether a timestamp is in seconds or milliseconds, which cron field is the day of the week, what 644 means, which headers in a HAR file are secrets. This guide collects those details in one place, with the tool for each.

By Radhika Singh · Last updated

Unix timestamps: count the digits

A Unix timestamp counts seconds since 00:00:00 UTC on January 1, 1970, ignoring leap seconds. Most mix-ups come from units: a 10-digit value such as 1795990000 is seconds (the usual unit in Unix tools, databases and most APIs), while a 13-digit value is milliseconds, which is what JavaScript's Date.now() returns. Divide by 1,000 or the date lands thousands of years away.

A timestamp has no time zone; it names one instant. Time zones only appear when you display it, which is why logs and APIs should store UTC and convert at the edge. Systems that store seconds in a signed 32-bit integer overflow at 03:14:07 UTC on January 19, 2038, so check old code and embedded devices. The Unix Timestamp Converter detects seconds, milliseconds, microseconds and nanoseconds automatically, shows the time in UTC, a US time zone and your own, and converts a whole list at once.

Cron: five fields and a time zone

Standard cron has five fields: minute, hour, day of month, month, day of week.

ExpressionRuns
*/15 * * * *Every 15 minutes
0 9 * * 1-509:00 Monday to Friday
30 2 1 * *02:30 on the first of every month
0 0 * * 0Midnight every Sunday (0 and 7 both mean Sunday)

Two details cause most surprises. When both day of month and day of week are set, classic cron runs when either matches, not both. And a schedule runs in the time zone of whatever executes it: GitHub Actions schedules run in UTC, so 0 9 * * * fires at 4 or 5 a.m. in New York depending on daylight saving time. Quartz and AWS EventBridge use six fields (seconds first, or a year at the end) with ? for an unused day field. The Cron Expression Generator explains an expression in English, handles all three dialects and lists the next runs in a time zone you pick.

chmod: three digits, three people

Each digit of a chmod number sums read (4), write (2) and execute (1), for the owner, the group and everyone else, in that order. 644 is the usual file setting (owner reads and writes, others read), 755 suits directories and scripts (everyone can enter or run, only the owner writes), and 600 keeps a file such as an SSH private key readable by its owner alone; ssh refuses keys that others can read.

On directories, execute means permission to enter, so a directory at 644 cannot be entered, even by its owner. The Chmod Calculator converts between the numeric and symbolic forms (rwxr-xr-x), covers setuid, setgid and the sticky bit, and writes the chmod command, including -R for recursive changes.

HAR files contain secrets

A HAR file is a recording of every request a browser made, which makes it the best thing to send a support team and one of the riskiest: it holds cookies, Authorization headers and tokens in URLs, enough to take over a session. The HAR Viewer opens one in your browser, lists slow and failed requests first, and has a Redact and download option that replaces cookies, authorization headers and token-like parameters with REDACTED before you share it. Recent Chrome versions can also export a sanitized HAR directly.

To replay one of those requests in code, copy it as cURL from the browser's network panel and turn it into Python, JavaScript or another language with the cURL to Code converter.

User agents tell you less than they used to

Browsers now send reduced user-agent strings: Chrome freezes most version details and the platform version, and offers the precise values through Client Hints only when a site asks for them. Use the user agent for analytics and bot detection, and feature detection for deciding what a browser supports. The User Agent Parser reads a string or a whole list, shows your own browser's client hints and flags known bots and crawlers.

Small front-end jobs

A handful of quick jobs round out the toolbox. Share previews come from Open Graph tags; a 1200 × 630 image is the safe size for most networks, and the Meta Tag Generator writes the tags with length meters for titles and descriptions, as HTML or as Next.js metadata. JavaScript and CSS minifiers shrink files for a quick deploy and beautify minified code you need to read. Layered shadows are easier to tune by eye in the Box Shadow Generator. CI files fail on a single misplaced space, so run them through the YAML Validator first. For scrapers and end-to-end tests, the XPath Tester checks a selector against real HTML or XML.

The tools in this guide

Found a mistake? Write in from the About page and it gets fixed.

Pick a tool.
Get it done.

125 utilities today, more every month. Bookmark the one you reach for.