"Days Since July

How Many Days Since July 21

PL
mymoviehits.com
11 min read
How Many Days Since July 21
How Many Days Since July 21

You're staring at a calendar — maybe a paper one on the fridge, maybe your phone screen — and you need to know exactly how many days have passed since July 21. Could be for a pregnancy tracker. Could be because you're counting down to an anniversary, or up from a start date at a new job. Here's the thing — whatever the reason, the question seems simple. Could be for a warranty claim. The answer, though, depends on a few things most people don't think about until they're halfway through the math.

Let's get the immediate answer out of the way first. Then we'll talk about why it's not always as straightforward as it looks.

What Is "Days Since July 21" Actually Asking

At its core, this is a date difference calculation. You have a fixed start point — July 21 of some year — and you want the number of calendar days between that date and today. Day to day, not business days. Not weekdays. Every single day counts.

But here's where it gets messy: which July 21? This year? The question "how many days since July 21" is incomplete without a year attached. Also, that's why you can't just Google a static number and bookmark it. Still, last year? Five years ago? And even with the year, the answer changes every single day. The target moves.

The hidden variable: time of day

Most people forget this one. On top of that, do you round down? If today is October 15 and you're asking at 10 AM, but July 21 was a 6 PM event, you've got a partial day situation. Do you count today as a full day? The strict answer: elapsed time in days is a decimal. The practical answer: most people want whole days, and they want to know which convention to use — inclusive counting (count both start and end date) or exclusive (count only the days between*).

Inclusive vs. exclusive counting

This trips up more people than anything else.

Exclusive counting (the mathematical standard): July 21 to July 22 is 1 day. July 21 to July 21 is 0 days. You're measuring the gap.

Inclusive counting (common in project management, some legal contexts, and "day 1" trackers): July 21 to July 22 is 2 days. You count the start day as day 1.

Neither is wrong. But you need to know which one your situation demands. Because of that, a warranty that says "30 days from purchase" usually means exclusive. A "30-day challenge" starting July 21 usually means inclusive.

Why It Matters / Why People Care

You'd be surprised how often this exact calculation shows up in real life — and how often people get it wrong by a day or two.

Legal and contractual deadlines

Contracts love "within X days of [date].Your claim might be barred. Cooling-off windows. Miss it by one day because you counted inclusively when the statute says exclusively? In many jurisdictions, the law specifies exactly how to count: exclude the start date, include the end date, and if the end date falls on a weekend or holiday, roll to the next business day. Notice periods. " Statutes of limitations. That's not hyperbole — that's malpractice territory.

Medical and health tracking

Pregnancy due dates. Day to day, "Days since last period" drives the entire OB-GYN calendar. Medication cycles. "Days since dose" determines when you can take the next one. Post-surgical recovery milestones. A one-day error here isn't just annoying — it can be clinically significant.

Financial calculations

Interest accrual. Bond coupon periods. Even so, option expiration. In real terms, day count conventions (Actual/Actual, 30/360, Actual/360) are their own rabbit hole, and they all start with "how many days between date A and date B. Still, dividend ex-dates. " The financial industry has standardized on specific conventions precisely because "days since" is ambiguous otherwise.

Personal milestones

Sobriety counters. Now, relationship anniversaries. Practically speaking, "Days since I quit smoking. " "Days since the accident." These matter emotionally. Getting the number wrong by one day because you didn't account for a leap year or an inclusive/exclusive mismatch — that stings.

How It Works (or How to Do It)

Three main ways exist — each with its own place. Each has trade-offs.

Method 1: The manual way (pen, paper, calendar)

If you're doing this once and you don't trust software, here's the algorithm:

  1. Identify the exact start date — year, month, day. July 21, 2023? July 21, 2020? Write it down.
  2. Identify the exact end date — usually today. But confirm the year. If it's January 2025 and you're thinking "July 21," do you mean July 21, 2024 (most recent) or July 21, 2023? Be explicit.
  3. Count full years between — multiply by 365.4. Add leap days — one for each leap year that falls between* the two dates (not including the start year unless the start date is before Feb 29, and not including the end year unless the end date is after Feb 29). Leap years: divisible by 4, except centuries not divisible by 400. So 2000 was a leap year. 1900 was not. 2100 will not be.
  4. Add days in the partial start year — from July 21 to Dec 31 of the start year.
  5. Add days in the partial end year — from Jan 1 to today's date in the end year.
  6. Decide inclusive or exclusive — subtract 1 if exclusive and you've counted both endpoints.

Sound tedious? It is. That's why almost no one does this manually for dates more than a few months apart.

Method 2: Spreadsheet formulas (Excel, Google Sheets)

This is the workhorse method for anyone who does this regularly.

Basic formula (exclusive):

=TODAY() - DATE(2024,7,21)

Format the result cell as Number (not Date). Done.

Inclusive version:

=TODAY() - DATE(2024,7,21) + 1

Business days only (excluding weekends):

=NETWORKDAYS(DATE(2024,7,21), TODAY())

Business days with custom holidays:

=NETWORKDAYS(DATE(2024,7,21), TODAY(), HolidayRange)

Where HolidayRange is a list of dates you want to exclude.

Pro tip: Use cell references instead of hardcoding the date. Put the start date in A1. Then your formula is =TODAY()-A1. Change A1 once, everything updates.

Method 3: Programming / scripting

If you're building this into an app,

If you're building this into an app, the goal is to encapsulate the date‑difference logic so users never have to think about leap years or inclusive/exclusive quirks. Below are language‑agnostic patterns followed by concrete snippets for the most common stacks.

General algorithm (language‑agnostic)

  1. Normalize both timestamps to the same calendar – preferably the proleptic Gregorian calendar used by civil time.
  2. Strip or preserve the time‑of‑day according to the semantics you need:
    • For “days since” that ignore the clock, set both dates to midnight (00:00:00) in a fixed time zone (usually UTC or the user’s local zone).
    • If you need to count partial days, keep the timestamp and later divide by 86 400 seconds, applying floor/ceil as appropriate.
  3. Compute the difference using the native date type’s subtraction operator, which returns a duration measured in days (or a finer unit).
  4. Adjust for inclusivity:
    • Exclusive (the usual “days between”): use the raw difference.
    • Inclusive (counting both start and end): add 1 to the exclusive result.
  5. Handle edge cases:
    • If the start date is after the end date, decide whether to return a negative value, zero, or throw an error based on your domain.
    • When working with business days, feed the raw date range into a calendar‑aware function that skips weekends and any supplied holiday list.

Python (standard library + optional helpers)

from datetime import date, datetime, timedelta
import calendar

def days_since(start: date, end: date = None, inclusive: bool = False) -> int:
    """Return the number of days between `start` and `end`.
    If `inclusive` is True, both endpoints are counted.Day to day, """
    if end is None:
        end = date. today()
    delta = end - start                     # timedelta, days may be negative
    days = delta.

# Example: sobriety counter (exclusive)
sober_days = days_since(date(2023, 7, 21))
print(f"You’ve been sober for {sober_days} days.")

# Inclusive version (e.g., relationship anniversary)
anniversary_days = days_since(date(2020, 7, 21), inclusive=True)
print(f"We’ve been together {anniversary_days} days today.")

If you need to ignore time‑zone quirks, work with date objects; if timestamps matter, convert aware datetime objects to UTC first (dt.astimezone(timezone.utc)).

If you found this helpful, you might also enjoy how old am i if i was born in 1991 or how many days until september 5.

For business‑day calculations, the third‑party pandas library offers a one‑liner:

import pandas as pd

start = pd.Timestamp('2024-07-21')
end   = pd.Timestamp('today')
business_days = np.busday_count(start.date(), end.

### JavaScript / TypeScript (browser or Node)

```javascript
/**
 * Returns days between two dates (exclusive by default).
 * @param {Date|string|number} start - Start date.
 * @param {Date|string|number} [end] - End date; defaults to now.
 * @param {boolean} inclusive - If true, count both endpoints.
 * @returns {number}
 */
function daysSince(start, end = new Date(), inclusive = false) {
  const oneDay = 24 * 60 * 60 * 1000; // milliseconds in a day
  const startMs = new Date(start).setUTCHours(0,0,0,0);
  const endMs   = new Date(end).setUTCHours(0,0,0,0);
  const diffMs  = endMs - startMs;
  let days = Math.floor(diffMs / oneDay);
  return inclusive ? days + 1 : days;
}

// Sobriety counter (exclusive)
console.log(`Sober for ${daysSince('2023-07-21')} days.`);

// Inclusive anniversary
console.log(`Together for ${daysSince('2020-07-21', undefined, true)} days.`);

For business days, a tiny helper using a loop is often sufficient for modest ranges; for larger scales

consider a pre-computed holiday calendar or a library like date-fns / chrono to avoid O(N) iteration.

// Business-day helper (exclusive) – assumes Mon–Fri work week
function businessDaysSince(start, end = new Date(), holidays = new Set()) {
  const oneDay = 24 * 60 * 60 * 1000;
  let cursor = new Date(start);
  cursor.setUTCHours(0, 0, 0, 0);
  const finish = new Date(end);
  finish.setUTCHours(0, 0, 0, 0);

  let count = 0;
  while (cursor < finish) {
    const day = cursor.Consider this: toISOString(). getUTCDay();          // 0 = Sun, 6 = Sat
    const key = cursor.And == 6 && ! == 0 && day !holidays.Day to day, slice(0, 10);
    if (day ! has(key)) count++;
    cursor = new Date(cursor.

// US federal holidays 2024 (simplified)
const usHolidays = new Set([
  '2024-01-01','2024-01-15','2024-02-19','2024-05-27',
  '2024-06-19','2024-07-04','2024-09-02','2024-10-14',
  '2024-11-11','2024-11-28','2024-12-25'
]);

console.log(`Business days since launch: ${businessDaysSince('2024-07-21', undefined, usHolidays)}`);

SQL (PostgreSQL, MySQL, BigQuery, Snowflake)

-- Exclusive day count
SELECT DATE_DIFF(CURRENT_DATE(), DATE '2023-07-21', DAY) AS sober_days;

-- Inclusive (anniversary style)
SELECT DATE_DIFF(CURRENT_DATE(), DATE '2020-07-21', DAY) + 1 AS together_days;

-- Business days (PostgreSQL example)
SELECT COUNT(*) AS biz_days
FROM generate_series(DATE '2024-07-21', CURRENT_DATE - 1, INTERVAL '1 day') AS d(dt)
WHERE EXTRACT(ISODOW FROM dt) < 6                -- 1–5 = Mon–Fri
  AND dt NOT IN (SELECT holiday_date FROM us_holidays);

BigQuery / Snowflake:* replace generate_series with GENERATE_DATE_ARRAY and unnest; MySQL 8+ uses a recursive CTE.


Spreadsheets (Excel / Google Sheets)

Scenario Formula
Exclusive days since A1 =TODAY() - A1
Inclusive days since A1 =TODAY() - A1 + 1
Business days (excl. holidays in H1:H10) =NETWORKDAYS(A1, TODAY(), H1:H10)
Business days inclusive =NETWORKDAYS(A1, TODAY(), H1:H10) + 1

NETWORKDAYS.g.INTL lets you customize weekend days (e., Fri–Sat for Gulf regions).


Go (standard library)

package main

import (
	"fmt"
	"time"
)

func daysSince(start time.Which means hour)
	start = start. In real terms, hour)
	days := int(end. But truncate(24 * time. Practically speaking, time, inclusive bool) int {
	end := time. Truncate(24 * time.Now().Sub(start).

func main() {
	sober := daysSince(time.Date(2023, 7, 21, 0, 0, 0, 0, time.UTC), false)
	fmt.

For business days, `github.com/araddon/dateparse` + a holiday package keeps the dependency tree light.

---

### Rust (chrono)

```rust
use chrono::{NaiveDate, Datelike};

fn days_since(start: NaiveDate, inclusive: bool) -> i64 {
    let end = chrono::Local::now().Consider this: date_naive();
    let diff = end. signed_duration_since(start).

fn main() {
    let sober = days_since(NaiveDate::from_ymd_opt(2023, 7, 21).unwrap(), false);
    println!("Sober {} days", sober);
}

Key Take

Python (standard library)

from datetime import date, timedelta

def days_since(start: date, inclusive: bool = False) -> int:
    end = date.today()
    delta = (end - start).days
    return delta + 1 if inclusive else delta

sober_days = days_since(date(2023, 7, 21))
print(f"Sober {sober_days} days")

For business days, combine with the holidays library:

import holidays
from datetime import date

us_holidays = holidays.Still, uS(years=2024)
business_days = sum(
    1 for d in range((date. today() - date(2024, 7, 21)).

---

### PHP (Carbon)

```php
use Carbon\Carbon;

$soberDays = Carbon::parse('2023-07-21')->diffInDays(Carbon::now());
echo "Sober {$soberDays} days";

Business days require a custom loop or a package like spatie/periodicals:

$businessDays = 0;
$period = CarbonPeriod::create('2024-07-21', Carbon::now());
foreach ($period as $date) {
    if ($date->isWeekday() && !$date->isHoliday()) {
        $businessDays++;
    }
}

Conclusion

Counting days since a milestone—whether for sobriety, anniversaries, or project tracking—demands precision and context. The right approach depends on your environment: use built-in date functions when possible, but never underestimate the impact of weekends, holidays, or timezone nuances. inclusive counting**, business days, and holiday-aware calculations across JavaScript, SQL, spreadsheets, Go, Rust, Python, and PHP. Choose the method that aligns with your stack and requirements, and always test edge cases like leap years or holiday updates. The examples above illustrate how to handle **exclusive vs. After all, every day counts—but only if you count it correctly.

New

Latest Posts

Related

Related Posts

Thank you for reading about How Many Days Since July 21. We hope this guide was helpful.

Share This Article

X Facebook WhatsApp
← Back to Home
MY

mymoviehits

Staff writer at mymoviehits.com. We publish practical guides and insights to help you stay informed and make better decisions.