Digital measurement guide

Time and Data Conversion

Choose the right units and time model.

Choose the right conversion model

A storage amount, an elapsed duration and a timestamp describe different things. Choose the unit system or time model before calculating: decimal and binary prefixes differ, calendar days can change length, and a local clock label may identify more than one instant.

This guide includes worked examples, two diagrams, practice answers and links that open the converters with the example inputs selected. Historical timezone examples use explicit dates in 2024 so their assumptions remain visible. For a future meeting, use the actual date and current timezone rules.

  1. Data quantity: identify bits or bytes, then decimal or binary prefixes. Converting the label preserves the underlying amount of information.
  2. Elapsed duration: identify a measured interval. Hours and minutes can be converted with fixed factors, but a decimal-hour number is not a clock-style hours-and-minutes string.
  3. Timestamp: identify one instant, the epoch and the unit of its numeric counter. For a formatted date-time, retain an explicit UTC indicator or offset.
  4. Local calendar time: retain the date and named timezone. Resolve missing or repeated clock times deliberately; a fixed offset alone does not describe all future rules for a location.

Do not fix an implausible answer by guessing a different unit. Return to the source label or API contract. The Common Unit Conversions guide explains the same dimensional method for physical quantities; this article adds the prefix and calendar conventions that digital work requires.

Reference diagram comparing decimal and binary data units, elapsed duration, time zones, and Unix time.
Data prefixes, a fixed-duration day and timestamp units describe different conventions. Local calendar days require date-aware timezone rules.

Decimal versus binary storage units

Decimal prefixes use powers of a thousand. Binary prefixes use powers of two and include an “i” in the symbol. Capitalization matters: the byte symbol is uppercase B, while bit-based rates are often written with lowercase b or the word bit. Use the complete label when a source uses an ambiguous abbreviation.

Exact byte and bit definitions
UnitExact relationshipSystem
Kilobyte1 kB=103 B=1000 B1\,\mathrm{kB}=10^3\,\mathrm B=1000\,\mathrm BDecimal
Kibibyte1 KiB=210 B=1024 B1\,\mathrm{KiB}=2^{10}\,\mathrm B=1024\,\mathrm BBinary
Megabyte1 MB=106 B1\,\mathrm{MB}=10^6\,\mathrm BDecimal
Mebibyte1 MiB=220 B1\,\mathrm{MiB}=2^{20}\,\mathrm BBinary
Gigabyte1 GB=109 B1\,\mathrm{GB}=10^9\,\mathrm BDecimal
Gibibyte1 GiB=230 B1\,\mathrm{GiB}=2^{30}\,\mathrm BBinary
Byte and bit1 B=8 bit1\,\mathrm B=8\,\mathrm{bit}Base relationship

Definitions: NIST binary prefixes and decimal comparisons.

Example: one gigabyte expressed in gibibytes

  1. Normalize the decimal amount to bytes: 1 GB=1,000,000,000 B1\,\mathrm{GB}=1{,}000{,}000{,}000\,\mathrm B.
  2. Use the binary unit size: 1 GiB=1,073,741,824 B1\,\mathrm{GiB}=1{,}073{,}741{,}824\,\mathrm B.
  3. Divide the byte amount by the bytes per gibibyte.1 GB=109230 GiB≈0.931322575 GiB1\,\mathrm{GB}=\frac{10^9}{2^{30}}\,\mathrm{GiB}\approx0.931322575\,\mathrm{GiB}

The reverse conversion is 1 GiB=1.073741824 GB1\,\mathrm{GiB}=1.073741824\,\mathrm{GB}. The unit-label change does not consume storage. Filesystem metadata, reserved space and partitions are separate reasons that usable capacity can be smaller than a device's nominal byte capacity.

Gigabyte and gibibyte compared on one byte scaleBoth bars start at zero. A gigabyte is 1000 megabytes; a gibibyte is 1073.741824 megabytes. One shared linear axis extends to 1200 megabytes.One gigabyte
1 GB=109 B1\,\mathrm{GB}=10^9\,\mathrm B
One gibibyte
1 GiB=230 B1\,\mathrm{GiB}=2^{30}\,\mathrm B
00
400400
800800
12001200
MB(106 B)\mathrm{MB}\quad(10^6\,\mathrm B)
Both bars compare byte counts using the same zero-based linear axis. The longer gibibyte bar represents a larger unit, not additional usable space created by changing a drive label.

Bits, bytes and ideal transfer time

A data amount and a data rate are not interchangeable. A rate has a time denominator. Convert bits and bytes consistently, then divide the amount by a rate in matching units. This provides an ideal duration only if that rate is sustained for the entire transfer.

100 Mbit/s×1 B8 bit=12.5 MB/s100\,\mathrm{Mbit/s}\times\frac{1\,\mathrm B}{8\,\mathrm{bit}}=12.5\,\mathrm{MB/s}

Example: an ideal file download

  1. Assume a decimal file size of 500 MB500\,\mathrm{MB} and a sustained payload rate of 100 Mbit/s100\,\mathrm{Mbit/s}.
  2. Convert the file amount: 500 MB=4000 Mbit500\,\mathrm{MB}=4000\,\mathrm{Mbit}.
  3. Divide amount by rate: t=4000 Mbit/(100 Mbit/s)=40 st=4000\,\mathrm{Mbit}/(100\,\mathrm{Mbit/s})=40\,\mathrm s.

Advertised connection speed is not a promise of that sustained payload rate. Protocol overhead, congestion, storage throughput and other traffic can increase the time. Compression can change the transmitted amount. State those assumptions before treating the estimate as a schedule.

Compare 100 megabits with megabytes

This link compares data amounts. The per-second rate relationship above uses the same bit-to-byte factor; the storage tool is not a live bandwidth test.

Elapsed duration is not calendar arithmetic

1 min=60 s1 h=3600 s1\,\mathrm{min}=60\,\mathrm s\qquad1\,\mathrm h=3600\,\mathrm s

For fixed-duration conversion, one day means exactly 24 h=86400 s24\,\mathrm h=86400\,\mathrm s. This definition does not claim that every pair of consecutive local midnights is that far apart. A calendar month also has no single fixed number of days. Average Gregorian month and year options are averages, not calendar deadlines.

Example: combine hours and minutes

  1. Identify the separate components: 2 h2\,\mathrm h and 30 min30\,\mathrm{min}.
  2. Convert both components to seconds.t=2(3600) s+30(60) s=9000 st=2(3600)\,\mathrm s+30(60)\,\mathrm s=9000\,\mathrm s
  3. Check in hours: 9000/3600=2.59000/3600=2.5. The result is 2.5 h2.5\,\mathrm h, not a decimal formed by joining the hour and minute digits.

Likewise, 1.5 h=90 min1.5\,\mathrm h=90\,\mathrm{min}. Decimal 1.30 h1.30\,\mathrm h is 78 min78\,\mathrm{min}, while the timer string 01:30:00 means one hour and thirty minutes. Always distinguish decimal quantities from timer syntax.

Unix seconds and JavaScript milliseconds

A Unix-style timestamp identifies an instant using a numeric counter relative to the epoch, 1970-01-01T00:00:00Z. Unix timestamps commonly use seconds; JavaScript Date stores milliseconds. Ordinary Unix/ECMAScript time does not count historical leap seconds as extra increments, so it should not be described as an uninterrupted SI-second clock across those insertions.

Let tst_s and tmst_{\mathrm{ms}} be the numerical counters for the same instant in seconds and milliseconds. Changing the counter unit changes the number, not the instant.

tms=1000tsts=tms1000t_{\mathrm{ms}}=1000t_s\qquad t_s=\frac{t_{\mathrm{ms}}}{1000}

Example: midnight at the start of 2024

  1. Start with the UTC instant 2024-01-01T00:00:00Z.
  2. Its Unix seconds counter is ts=1,704,067,200t_s=1{,}704{,}067{,}200. Multiply by 10001000 to obtain tms=1,704,067,200,000t_{\mathrm{ms}}=1{,}704{,}067{,}200{,}000.
  3. Choose the matching input unit before decoding. Both correctly labeled inputs return the same UTC date-time. Interpreting the seconds number as milliseconds instead places it near the beginning of 1970.
Three inputs representing the same instant
Input interpretationLiteral inputCheck it
Unix seconds1704067200Open this input
Unix milliseconds1704067200000Open this input
Offset-qualified date-time2024-01-01T04:00:00+04:00Open this input

Zero identifies the epoch; −1-1 Unix second identifies the preceding second. Digit counts alone cannot reliably infer the unit, especially for small, negative or fractional values. A date-time string without a UTC indicator or offset can be interpreted differently by different environments. For fractional values, check whether the receiving system preserves them, rounds them or truncates them.

The offset-qualified input above subtracts its four-hour offset to resolve the same UTC instant. A numeric offset is sufficient for that instant, but it is not a complete timezone rule for future recurrences. See ECMAScript time values and RFC 3339 timestamp conventions.

Convert a meeting using a date and named zones

IANA names such as America/New_York, Europe/London and Asia/Dubai identify location-based rule sets. An abbreviation alone can be ambiguous, and a fixed offset copied from today can be wrong for another date.

Example: a historical January meeting

  1. Enter January 15, 2024, at 09:00 in New York. On that date, its offset was UTC−05:00.
  2. Resolve the instant as 2024-01-15T14:00:00Z.
  3. Display that same instant in the other zones: London was 14:00 and Dubai was 18:00, both on January 15.

The time conversion does not guarantee a convenient meeting. Dubai's time is after a typical afternoon work window, and working hours, holidays and leave need their own checks. The linked planner checks configured weekly work windows; it does not infer holidays or calendar bookings.

Open the dated meeting example

For a recurring local meeting, retain its local time, zone and recurrence rule. Resolving each occurrence is different from repeating one stored UTC offset forever. Update the browser or runtime timezone data and reconfirm future schedules when regional rules change. IANA explains how the database is maintained.

Daylight saving gaps and repeated times

Spring: a clock label that never occurs

In New York on March 10, 2024, the local clock jumped from the end of the 01:00 hour to 03:00. The local time 02:30 did not exist. A strict converter should reject that input or require an explicit adjustment policy instead of silently pretending it is an ordinary instant.

The interval from local 01:30 to 03:30 was only 1 h1\,\mathrm h of elapsed time: the corresponding UTC instants were 06:30 and 07:30. Consecutive local midnights bounding that calendar day were twenty-three hours apart.

Autumn: one label with two possible instants

On November 3, 2024, New York's 01:30 occurred twice. The earlier occurrence was 2024-11-03T05:30:00Z; the later one was 2024-11-03T06:30:00Z. They were an hour apart even though the local date and clock label matched. That local calendar day spanned twenty-five elapsed hours.

Uniform UTC time with skipped and repeated New York clock labelsOn March 10, 2024, UTC 06:30, 07:00 and 07:30 correspond to New York 01:30, 03:00 and 03:30. On November 3, UTC 05:30, 06:00 and 06:30 correspond to local 01:30, 01:00 and 01:30. Adjacent instants are thirty elapsed minutes apart in both diagrams.Spring forward: March 10, 2024UTC: equally spaced instants06:3001:3007:0003:0007:3003:30New York: local clock labelsThe 02:00 hour is skipped.Fall back: November 3, 2024UTC: equally spaced instants05:3001:3006:0001:0006:3001:30New York: local clock labelsThe two 01:30 labels are distinct instants.
Each horizontal step is thirty elapsed minutes. Only the UTC timeline is continuous; the local labels below it jump in spring and repeat in autumn. These are historical New York examples, not a universal clock-change rule.

Historical dates: US Naval Observatory, 2024 daylight saving time. These one-hour transitions are examples, not a rule for every zone or historical clock change.

Practice with worked answers

Identify the model before doing the arithmetic. Open each answer after deciding which unit definition or time reference applies.

How many bytes are in three mebibytes?
3 MiB=3×220 B=3,145,728 B3\,\mathrm{MiB}=3\times2^{20}\,\mathrm B=3{,}145{,}728\,\mathrm B

Use the binary prefix, not the decimal megabyte factor. The same bytes can be expressed in decimal units, but the numerical value changes.

How many minutes are in 1.75 decimal hours?
1.75 h×60 min1 h=105 min1.75\,\mathrm h\times\frac{60\,\mathrm{min}}{1\,\mathrm h}=105\,\mathrm{min}

The fractional part is a fraction of an hour, not a minute field. This is one hour and forty-five minutes.

What Unix seconds value corresponds to 1500 milliseconds?
ts=15001000=1.5t_s=\frac{1500}{1000}=1.5

The value is one and a half seconds after the Unix epoch. Retain the fraction unless the destination explicitly requires whole seconds and specifies a rounding policy.

Time and data conversion questions

Why does a drive show fewer GiB than its advertised GB?

The units have different sizes. A gigabyte contains 10910^9 bytes, while a gibibyte contains 2302^{30} bytes. Expressing the same byte count in gibibytes produces a smaller number. This unit change does not remove data. Formatting, filesystem metadata, reserved capacity and recovery partitions can reduce usable capacity separately, so distinguish the prefix calculation from actual available storage.

Are Mbps and MB/s interchangeable?

No. A byte contains eight bits, so a decimal rate of 100 Mbit/s100\,\mathrm{Mbit/s} corresponds to 12.5 MB/s12.5\,\mathrm{MB/s} before transfer overhead. Preserve both the bit-or-byte symbol and the time denominator. A storage converter compares amounts; a transfer-time estimate additionally needs a sustained rate and assumptions about protocol overhead, compression and other activity sharing the connection.

Is one day always twenty-four hours?

A fixed-duration day is defined here as 24 h24\,\mathrm h, or 86400 s86400\,\mathrm s. A local calendar day is a different concept: the elapsed time between consecutive local midnights depends on civil-time rules. In the New York examples, the spring transition day spans twenty-three hours and the autumn day spans twenty-five. Do not use a fixed-day converter to infer a calendar deadline.

Can timestamp units be inferred from the number of digits?

Digit counts are a debugging clue, not a reliable data contract. Values near the epoch, negative timestamps and fractional seconds break simple length rules. Read the API specification or data-field definition and choose seconds, milliseconds or another documented unit explicitly. The converter preserves the selected unit; it does not silently reinterpret a value because a guessed date looks more plausible.

What should I do when a local time occurs twice?

Keep the date and IANA zone, then select the earlier or later occurrence deliberately. During a backward clock change, two different UTC instants can share one local clock label. Recording only the label loses that distinction. Store the resolved instant for an actual event, and preserve the zone or recurrence rules when future scheduling also needs the original local-time intent.

Should I store UTC for every kind of date and schedule?

Use an unambiguous instant, such as an offset-qualified timestamp, for an event that happened at a specific moment. A birthday, a date-only deadline or a recurring local meeting has different semantics. Preserve a date-only value when no instant is intended; preserve local time, zone and recurrence rules for recurring schedules, then resolve each occurrence with current timezone data.

Sources and example assumptions

The arithmetic examples use exact unit definitions and nominal input values. Timezone examples identify a historical date and zone; they are checked against the runtime's named-zone resolver and independent offset arithmetic. Timestamp values use the ordinary Unix/ECMAScript model, with no leap-second label input assumed.

Editorial Transparency

Who maintains this page

Ownership and review

Written and maintained by the Toolarithm editorial team. The method was last reviewed on . No independent professional review is claimed.

Methodology

The editorial team checks definitions, examples, linked tools, and cited references. Dates shown here come from the page's maintained publication record.

Read the editorial methodology

Dates and sources

Published . Updated .