Your 8-Hour Night Shift Is Only 480 Minutes and Pregnancy Is Exactly 40 Weeks

Calculate shift duration in decimal hours, find the time difference across midnight, and count weeks between dates. Three date and time tools explained with real examples.

Patryk Matyjasik · 23 June 2026

How long did you actually work last night? The clock on the wall said 22:00 when you walked in and 06:30 when you left. Quick subtraction gives you... negative 15 hours and 30 minutes? That cannot be right. Midnight resets the clock to zero, and suddenly basic arithmetic stops working.

Three calculators in the Date & Time section handle exactly these kinds of problems. One measures duration between two clock times. Another finds the absolute difference - useful when you do not care about direction, just the gap. The third counts weeks between two dates, which turns out to be surprisingly important for pregnancy, project management and fitness programs.


08:30 to 17:15 - the decimal hour problem

A standard work day might run from 08:30 to 17:15. The Duration Calculator returns three numbers at once:

  • 8 hr 45 min in the familiar format
  • 8.75 in decimal hours
  • 525 total minutes
Duration Calculator showing 08:30 to 17:15 equals 8 hr 45 min or 8.75 decimal hours

The decimal value is the one your timesheet wants. Multiply 8.75 by your hourly rate and you get an exact dollar amount. No rounding, no guessing, no "about eight and three quarters." Payroll software lives on decimals, not HH:MM.

Here is something that trips people up: 45 minutes is not 0.45 hours. It is 0.75. The conversion is division by 60, not by 100. A quick reference:

MinutesDecimalMinutesDecimal
100.17350.58
150.25400.67
200.33450.75
300.50500.83

The calculator also reports total seconds. That number looks absurdly large - 31,500 seconds for an 8.75-hour shift - but video editors, lab researchers and anyone working with timestamps in milliseconds will recognize its usefulness.


The midnight problem

Now for that night shift. You clocked in at 22:00 and clocked out at 06:30. If you subtract 22:00 from 06:30, the math is wrong because the end time is numerically smaller than the start time. The clock reset at midnight.

The Time Zone Difference calculator solves this with a single checkbox: "Time crosses midnight." Check the box, and the calculator adds 24 hours before subtracting.

Time Zone Difference showing 22:00 to 06:30 across midnight equals 8 hr 30 min

Result: 8 hours 30 minutes, or 8.50 decimal hours. Without the checkbox, the same pair of times returns 15 hours 30 minutes - which is the gap going the other direction around the clock.

That distinction matters more than you might think. Consider these scenarios:

Time 1Time 2Same dayAcross midnight
22:0006:0016 hr8 hr
23:3002:1521 hr 15 min2 hr 45 min
20:0008:0012 hr12 hr

The last row is interesting. When the gap is exactly 12 hours, both modes give the same answer. That only happens at the midpoint of the 24-hour cycle.

So what is the difference between the Duration Calculator and the Time Zone Difference tool? The Duration Calculator measures elapsed time from a defined start to a defined end. The Time Zone Difference finds the absolute gap between any two clock readings regardless of order. For same-day spans the numbers are identical. The distinction only shows up when midnight is involved and direction matters.


40 weeks of pregnancy

Weeks feel like a strange unit. We use hours for shifts, days for deadlines, months for rent. But some things are measured specifically in weeks, and pregnancy is the most common example.

A full-term pregnancy is 40 weeks from the first day of the last menstrual period. The Weeks Calculator takes two dates and returns the exact count.

Weeks Calculator showing January 6 to October 13 equals exactly 40 weeks

Enter January 6 as the start and October 13 as the end: 40 weeks and 0 days. That is 280 days, 6,720 hours, approximately 9.2 months.

The "show remaining days" option is what makes this tool different from a simple day counter divided by 7. Pregnancy apps report "you are in week 28." But are you at the start of week 28 or the end? With the remaining days shown, you get "28 weeks and 3 days" - precise enough for medical milestones where a single week changes the clinical plan.

Other contexts where weeks are the natural unit:

ContextTypical lengthWhy weeks?
Pregnancy40 weeksMedical milestones tracked weekly
Couch to 5K9 weeksTraining phases in weekly blocks
Agile sprint2 weeksIndustry standard iteration
College semester15-16 weeksAcademic calendar
Notice period2-4 weeksEmployment law

No calendar month has exactly 4 weeks. January has 4 weeks and 3 days. February in a common year is the only month that fits: 28 days, 4 weeks, zero remainder.


A year is not 52 weeks

One more thing the Weeks Calculator quietly reveals. Enter January 1 and December 31 of the same year. The result is not 52 weeks. It is 52 weeks and 0 days for a 364-day span (Dec 31 minus Jan 1 = 364 days), but an actual year has 365 days - which is 52 weeks and 1 day. In a leap year, it is 52 weeks and 2 days.

This is why the last week of the year always feels off. Payroll for "week 52" sometimes includes an extra day (or two). Accounting systems that assume 52 equal weeks end up one or two days short. The calculator handles the math correctly and shows you the remainder that most calendar grids quietly hide.


Tools discussed in this article

Duration Calculator - measure the elapsed time between two clock times in hours, minutes, decimal format and total seconds.

Time Zone Difference - find the absolute gap between two clock readings, including shifts that cross midnight.

Weeks Calculator - count the number of full weeks and remaining days between two dates.

More tools from Date & Time


Check for a specific duration