What Date Was 17 Weeks Ago
You're staring at a calendar. Maybe it's a project deadline. In practice, maybe it's a pregnancy milestone. Maybe it's a legal filing window, a visa requirement, or just a "where did the time go" moment. Whatever brought you here, you need to know: what date was 17 weeks ago?
The short answer: count back 119 days from today. But the real answer — the one that keeps you from missing a deadline or booking the wrong flight — has a few more moving parts.
What Is a 17-Week Window Anyway
Seventeen weeks. In real terms, roughly four months minus a week. One hundred nineteen days. It's a strange, specific interval that shows up in more places than you'd expect.
In pregnancy tracking, 17 weeks marks the start of the second trimester's "sweet spot" — nausea usually fading, energy returning, anatomy scan approaching. In project management, it's a common sprint-cycle multiple: four four-week sprints plus a buffer. In US immigration, certain visa categories use 120-day (roughly 17-week) lookback periods for presence calculations. In finance, some rolling-window calculations — trailing returns, lookback periods for tax-loss harvesting — hover right around this mark.
The number itself isn't magic. No leap-year exceptions, no month-length variations. But the precision* matters. A week is seven days. And always. That's what makes weeks reliable for counting backward — and also what makes them deceptive when you try to map them onto calendar months.
Why 17 Weeks Specifically
You rarely hear "16 weeks ago" or "18 weeks ago" in casual conversation. It's the default anatomy-scan window in prenatal care. But 17 weeks? So it's a standard lookback for FMLA eligibility calculations in some employer policies. It's the CDC's recommended interval between certain vaccine doses. It's the length of a typical semester minus finals week.
If you're asking this question, odds are you're anchored to one of those frameworks — even if you don't realize it yet.
Why It Matters / Why People Care
Miss a 17-week deadline by three days and you might just reschedule an ultrasound. And miss it in a visa context and you're looking at a denial. Miss it in a tax-loss harvesting window and you've lost a deduction for the year.
The stakes change the math.
The Pregnancy Angle
At 17 weeks pregnant, you're 119 days from your last menstrual period (LMP) — assuming a 28-day cycle and textbook ovulation. But "17 weeks ago" from today* isn't your conception date. It's not even your LMP date unless today happens to be exactly 17 weeks from that day.
This confusion trips people up constantly. They Google "17 weeks ago" thinking they'll get their due date or conception window. They get a calendar date instead. Then they panic.
Here's the thing: pregnancy dating uses completed* weeks. But at 17 weeks 0 days, you've completed 17 full weeks. At 17 weeks 6 days, you're still "17 weeks pregnant" but you've lived 125 days since LMP. Worth adding: the phrase "17 weeks ago" doesn't carry that nuance. It's a flat 119-day subtraction.
The Legal & Compliance Angle
Immigration attorneys know this number cold. In real terms, the "180-day rule" for unlawful presence? That's roughly 25.7 weeks. But the "120-day lookback" for certain J-1 waiver calculations? That's 17 weeks and change.
Employment lawyers track 17-week windows for FMLA rolling-year calculations. Some state paid-leave programs use 17-week base periods for benefit eligibility. Workers' comp waiting periods in a handful of jurisdictions? 17 weeks exactly.
If you're in HR, compliance, or immigration, you're not asking "what date was 17 weeks ago" for fun. You're verifying a hard boundary.
The Financial Angle
Trailing 120-day returns. Also, quarterly lookbacks. Wash-sale windows (30 days before and after — 60 days total, not 17 weeks, but advisors often model 17-week rolling volatility windows for risk parity).
The SEC's Rule 144 holding period for restricted securities? Neither is 17 weeks. But for non-reporting companies, it's one year. Six months for reporting companies — roughly 26 weeks. Still, portfolio managers run 17-week rolling Sharpe ratios because it's a clean quarter-plus-one that smooths monthly noise without stretching to a full half-year.
How It Works (or How to Do It)
The Basic Math
Today's date minus 119 days. Here's the thing — that's it. That's the whole calculation.
But "today" is slippery. Are you calculating from midnight UTC? Your local midnight? The moment you hit enter? Which means most online calculators use your device's local date at load time. That means if you check at 11:59 PM and again at 12:01 AM, you'll get two different answers.
For high-stakes uses, define your anchor explicitly: "17 weeks before June 15, 2024" not "17 weeks ago."
Manual Calculation (No Tools)
You can do this on a paper calendar. Count back 17 Sundays (or Mondays, whichever your week starts on). Think about it: each jump of 7 days lands you on the same weekday. Seventeen jumps = 119 days.
But watch the month boundaries. Counting back from March 15:
- March 15 → March 8 → March 1 → February 22 → February 15 → February 8 → February 1 → January 25 → January 18 → January 11 → January 4 → December 28 → December 21 → December 14 → December 7 → November 30 → November 23
That's 17 weeks. February has 28 days (29 in leap years). Did you catch the February 1 → January 25 jump? That's where people lose days. November 23. The 7-day step doesn't care about month length — but your eyes do.
Using Spreadsheets
Excel and Google Sheets make this trivial:
=TODAY() - 119
Or if you want a specific anchor date in cell A1:
=A1 - 119
Want business days only? That's a different beast. Think about it: WORKDAY(TODAY(), -119) excludes weekends. WORKDAY(TODAY(), -119, holidays_range) excludes your custom holidays too. But 17 weeks* of business days isn't 119 days — it's 17 × 5 = 85 business days, which spans roughly 23 calendar weeks.
Don't mix these up. I've seen visa petitions rejected because someone used business-day math for a calendar-day requirement.
Programming It
Python:
from datetime import date, timedelta
target = date.today() - timedelta(weeks=17)
# or
target = date.today() - timedelta(days=119)
JavaScript:
const target = new Date();
target.setDate(target.getDate() - 119);
SQL (PostgreSQL):
SELECT CURRENT_DATE - INTERVAL '
**SQL (PostgreSQL)**
```sql
SELECT CURRENT_DATE - INTERVAL '119 days' AS start_date;
The result is a date type representing the calendar day exactly 119 days before today. If you need a timestamp, use CURRENT_TIMESTAMP - INTERVAL '119 days'.
SQL (MySQL / MariaDB)
SELECT CURDATE() - INTERVAL 119 DAY AS start_date;
For a timestamp version:
SELECT NOW() - INTERVAL 119 DAY AS start_ts;
SQL (SQLite) – SQLite stores dates as TEXT, INTEGER (Unix epoch), or REAL. The most portable way is to let the engine do the math:
Continue exploring with our guides on how long ago was 20 weeks and what year was it 80 years ago.
Continue exploring with our guides on how long ago was 20 weeks and what year was it 80 years ago.
Continue exploring with our guides on how long ago was 20 weeks and what year was it 80 years ago.
Continue exploring with our guides on how long ago was 20 weeks and what year was it 80 years ago.
Continue exploring with our guides on how long ago was 20 weeks and what year was it 80 years ago.
Continue exploring with our guides on how long ago was 20 weeks and what year was it 80 years ago.
SELECT date('now', '-119 days') AS start_date;
If you need a UTC epoch:
SELECT strftime('%s', 'now', '-119 days') AS start_epoch;
SQL (Oracle)
SELECT SYSDATE - 119 AS start_date FROM dual;
For a more explicit interval:
SELECT CAST(SYSDATE AS DATE) - INTERVAL '119' DAY AS start_date FROM dual;
Keeping It Consistent Across Systems
When the same 17‑week window is evaluated in multiple environments (e.g., a data‑lake query, a BI dashboard, and a back‑testing engine), subtle differences can creep in:
| Issue | Why It Matters | Fix |
|---|---|---|
| Time‑zone drift | CURRENT_DATE in PostgreSQL is UTC, while CURDATE() in MySQL is also UTC, but many application servers treat “today” as the local calendar day. That's why |
|
| **Weekend vs. Plus, | Explicitly subtract days, not workdays. calendar weeks** | The 17‑week Sharpe ratio is defined on calendar weeks, not business days. |
| Leap‑year edge cases | Subtracting 119 days from 29‑Feb 2020 yields 1‑Mar 2019, not 2‑Mar 2019. | Always use day‑based arithmetic (INTERVAL '119 days') rather than month‑based offsets. On top of that, if you need business‑day logic, compute a separate metric and label it clearly. Some naïve month‑based calculations mis‑handle this. In practice, |
| Daylight‑saving transitions | When a date‑time is stored as a timestamp and you subtract days, the wall‑clock time may cross a DST boundary, causing a 23‑ or 25‑hour difference. Using WORKDAY or DATEADD with weekday flags will shift the window. |
Work with date‑only fields for the 17‑week window; keep timestamps only for intraday analysis. |
A pragmatic pattern is to define a scalar‑valued function in your database that returns the 17‑week start date, e.g.:
-- PostgreSQL example
CREATE OR REPLACE FUNCTION window_start_17weeks()
RETURNS DATE AS $
BEGIN
RETURN CURRENT_DATE - INTERVAL '119 days';
END;
$ LANGUAGE plpgsql;
Then reference it everywhere:
SELECT window_start_17weeks() AS start_date, …
Because the logic lives in one place, a later adjustment (e.g., switching to a 18‑week lookback) only requires editing the function.
Automation & Validation
If you’re building a pipeline that computes rolling Sharpe ratios nightly, sprinkle in a few sanity checks:
- Anchor consistency – Log the raw anchor date (
CURRENT_DATE) and the derived start date. Spot‑check that the difference is always 119 days, regardless of DST shifts. - Range sanity – Ensure the start date is not in the future and not older than your data‑history cutoff (e.g., you may only have three years of price data).
- Cross‑system verification – Run the same calculation in a language you trust (Python, R) and compare the resulting date. A mismatch signals a hidden off‑by‑one error.
- Unit tests – For known dates (e.g., 2024‑06‑15) compute the expected start date manually and assert equality in your test suite.
A tiny Python snippet that can be embedded in a CI job:
Embedding the 17‑week anchor in a reusable routine is only the first step; the real value emerges when the calculation is part of a repeatable, auditable pipeline.
**Logging and auditability**
Every nightly run should emit a concise log entry that records the raw anchor date, the computed start date, and the number of rows that will be evaluated. A simple `INSERT INTO etl_audit (run_id, anchor_date, start_date, row_count, run_timestamp) VALUES (…)` statement guarantees that a historical trail exists even if downstream tables are later overwritten. Tagging the run with a UUID makes it trivial to correlate logs across micro‑services or batch jobs.
**CI/CD validation**
Treat the scalar function as a library component. When the repository is updated, a CI pipeline can spin up a temporary database, execute a handful of deterministic test cases (e.g., “given 2024‑01‑01, expect 2019‑09‑13”) and fail the build if the result diverges. Because the function is pure SQL, the test harness can be as lightweight as a `psql` command executed in a Docker container. This practice catches accidental changes — such as a mistaken `CURRENT_TIMESTAMP` versus `CURRENT_DATE` — before they propagate to production.
**Cross‑language verification**
Even with a solid test suite, it is prudent to run the same logic in a language that the data‑science team already uses. A Python function that mirrors the SQL arithmetic:
```python
from datetime import date, timedelta
def window_start_17weeks(reference: date = None) -> date:
if reference is None:
reference = date.today()
return reference - timedelta(days=119)
# Example usage
print(window_start_17weeks()) # 2019-09-13 for today’s date
Running this script in a nightly cron job and comparing its output to the SQL result provides an independent sanity check. Any discrepancy should trigger an alert and a manual review of the underlying date‑handling logic.
Data‑quality gates
Beyond the basic anchor checks, introduce a few additional gates:
- Future‑date guard – reject runs where the start date lies beyond the current calendar day; this prevents accidental forward‑looking windows caused by clock skew.
- Historical‑coverage guard – verify that the start date is no earlier than the earliest date present in the price table; if the warehouse contains only three years of data, a 17‑week window that begins ten years ago will produce empty results.
- Row‑count sanity – after the window is applied, confirm that the expected number of daily records (≈ 119 × 365 ≈ 43 435) is present. A sudden drop may indicate a missing partition or a recent schema change.
Automated alerting
Configure a monitoring rule that fires when the row count deviates by more than a configurable threshold (e.g., ±10 %). The alert can be routed to a Slack channel or an incident‑management system, giving the data‑engineering team immediate visibility. Pair this with a dashboard that plots the start‑date trend over time; abrupt jumps could signal a change in the underlying CURRENT_DATE source (for example, a shift from a local server clock to a UTC‑based scheduler).
Versioning and documentation
Document the purpose of the 119‑day offset in the data‑dictionary, and keep a changelog for the scalar function. When the business decides to extend the look‑back to 18 weeks, the change is a single line in the function body, but the documentation should note the rationale and any impact on the Sharpe‑ratio calculation (e.g., reduced volatility estimate, altered exposure). Storing the function definition in a version‑controlled repository (Git) together with its unit tests ensures that every modification is traceable.
Orchestration considerations
If the pipeline is orchestrated by a workflow engine such as Apache Airflow or Prefect, the 17‑week start date can be passed as a parameter to downstream tasks rather than recomputed in each operator. This reduces duplication and makes it easy to experiment with alternative windows (e.g., 15 weeks for a “short‑term” view) by simply adjusting the parameter value.
Conclusion
A well‑engineered 17‑week Sharpe‑ratio calculation hinges on a single, deterministic anchor date. Also, by centralizing the date arithmetic in a scalar‑valued function, logging the anchor and derived values, validating the result through CI pipelines and cross‑language checks, and enforcing data‑quality gates, the process becomes reproducible, auditable, and resilient to time‑zone or daylight‑saving quirks. When these practices are coupled with automated alerts and clear documentation, the rolling metric can be trusted to support investment decisions without hidden surprises.
Latest Posts
Related Posts
More Good Stuff
-
What Time Was It 7 Hours Ago
Jul 30, 2026
-
What Time Was It 5 Hours Ago
Jul 30, 2026
-
What Day Was It 1798 Days Ago
Jul 30, 2026
-
What Time Was 18 Hours Ago
Jul 30, 2026
-
What Time Was It 6 Hours Ago
Jul 30, 2026