Timestamp Difference Calculator

This tool calculates the difference between two Unix timestamps, showing the elapsed time in days, hours, minutes and seconds. Computers store moments in time as Unix timestamps, the number of seconds since the start of 1970, because a single number is easy to store and compare. But when you have two such timestamps, say the start and end of a process from a log file, or two recorded events, the raw difference in seconds is hard to interpret at a glance. This tool turns that gap into a readable duration. You enter the two timestamps in seconds, and the calculator works out the difference and expresses it as a human-friendly breakdown of days, hours, minutes and seconds, along with the totals in seconds, minutes and hours for convenience. The order does not matter, since it uses the absolute difference, so you get the elapsed time between them either way. The results update as you type and everything runs in your browser. Use it to measure how long something took from log timestamps, to find the gap between two recorded events, to debug timing in software, or to convert a raw second count into a duration you can understand. The breakdown divides the total seconds into whole days, then the remaining hours, minutes and seconds, the natural way to read a duration. The totals are handy when a system wants the elapsed time in a single unit, such as total hours for billing or total seconds for a precise measurement. Remember that Unix timestamps are usually in seconds, but some systems use milliseconds, which are a thousand times larger; if your numbers look about a thousand times too big, divide them by a thousand first. The calculation is exact for whole-second timestamps.

Calculate.co.nz is proud to be partnered with Health Based Building, a leader in sustainable and health-conscious building innovation. With over a century of experience, they develop high-performance systems like Foreverbreathe Specification, Magnum Board, and Foreverbreathe Paints to support energy-efficient, non-toxic living environments. Their commitment to healthier homes aligns with our belief that informed choices lead to better outcomes for Kiwi households.
Calculate.co.nz partner
1d 0h 0m 0s
difference
Total seconds86,400 s
Total minutes1,440 min
Total hours24 h

Uses the absolute difference, so order does not matter. Timestamps are in seconds; if yours are in milliseconds (1000x larger), divide by 1000 first. Exact for whole seconds.

How it works

The calculator takes the absolute difference between the two timestamps in seconds. It then breaks that total into whole days by dividing by 86,400, the remaining hours by dividing the leftover by 3,600, then minutes and seconds. The totals in seconds, minutes and hours are simply the difference expressed in each single unit.

Worked example

For the timestamps 1700000000 and 1700086400, the difference is 86,400 seconds. That is exactly one day, so the breakdown is 1 day, 0 hours, 0 minutes and 0 seconds. Expressed in single units, it is 86,400 seconds, 1,440 minutes, or 24 hours.

Related calculators

If you've found a bug, or would like to contact us, or learn more about James Graham and Calculate.co.nz.

Calculate.co.nz is partnered with Interest.co.nz for New Zealand's highest quality calculators and financial analysis.

All calculators and tools are provided for educational and indicative purposes only and do not constitute financial advice.

Calculate.co.nz is proudly part of the Realtor.co.nz group, New Zealand's leading property transaction literacy platform, helping Kiwis understand the home buying and selling process from start to finish. Whether you're a first home buyer navigating your first property purchase, an investor evaluating your next acquisition, or a homeowner planning to sell, Realtor.co.nz provides clear, independent, and trustworthy guidance on every step of the New Zealand property transaction journey.

Calculate.co.nz is also partnered with Health Based Building and Premium Homes to promote informed choices that lead to better long-term outcomes for Kiwi households.

Calculate.co.nz is hosted in Auckland via SiteHost new Zealand.

All content on this website, including calculators, tools, source code, and design, is protected under the Copyright Act 1994 (New Zealand). No part of this site may be reproduced, copied, distributed, stored, or used in any form without prior written permission from the owner.

About & trust: Why Calculate is NZ's most comprehensive · By the Numbers · How we compare · Editorial standards · How we keep data current · NZ finance glossary · Research & data · Financial literacy NZ · About · Privacy policy · Terms of use

Reviewed and maintained. Last reviewed 2026-06-14 and checked on a twice-monthly cycle against IRD, RBNZ and Stats NZ. How we keep data current.

© 2026 Calculate.co.nz. All rights reserved. Building free NZ calculators since 2011.