Why a Time Origin Must Be Explicit
A timestamp says when an event occurred on a calendar or clock. A relative time says how far that event is from a chosen reference point. In pharmacometric data, the reference point may be defined by the study protocol for each subject—for example, a specified treatment start or another protocol-defined event. Changing that origin changes every relative time, even though the calendar timestamps stay the same.
There is no single universal meaning of “study day.” It may refer to a day numbered from a calendar date, or to a 24-hour interval counted from an exact timestamp. Those approaches can assign different values to the same record. The convention is therefore part of the data definition: identify the origin, specify how days are counted, and apply that rule consistently.
The earlier material on observation time versus calendar time distinguishes timestamps from relative time. Here the key additional decision is which reference point defines relative time, and how a day label is derived from it. Use a subject-specific origin when the protocol defines a separate reference for each subject; do not substitute one subject’s origin for another’s.
Elapsed Time From an Exact Timestamp
If both the event and origin are available as timestamps on a common time basis, calculate elapsed time by subtraction. For example, elapsed time in hours is the event timestamp minus the origin timestamp, expressed in hours. The result is signed: positive values are after the origin, zero is at the origin, and negative values are before it. A predose record can therefore have negative elapsed time even if it occurs on the same calendar date as the origin.
Here \(t_{ij}\) is elapsed time for record \(j\) from subject \(i\). The subtraction produces a duration; report its unit explicitly, such as hours or days. If the timestamps include time zones, compare them as instants on a common time basis. If they are recorded in local clock time, the relevant time zone and any daylight-saving transition must be considered before interpreting the difference as a duration.
A date without a time does not identify an exact instant. Consequently, date-only values can support a date-based study day, but they do not support an exact elapsed-time calculation. Assigning midnight to a date-only value without a documented convention invents timing information that was not recorded.
Worked Example: Predose and Post-Origin Records
Suppose a hypothetical subject has a protocol-defined origin of March 10, 2026, at 08:00. Consider records at March 10, 07:30; March 10, 08:00; March 11, 07:00; and March 11, 08:15. Calculate elapsed hours. For comparison, also calculate date-based study day using the convention that the origin date is Study Day 1.
For each record, subtract the origin timestamp. The first record is 30 minutes before the origin, so \(t = -0.5\) hours. At the origin, \(t = 0\) hours. The March 11, 07:00 record is 23 hours after the origin, and the March 11, 08:15 record is 24 hours and 15 minutes after it, or 24.25 hours.
Under the stated date-based convention, both March 10 records are on Study Day 1, including the predose record; both March 11 records are on Study Day 2. Thus the March 10, 07:30 record is Study Day 1 but has negative elapsed time. These values are not contradictory: the study day is based on the calendar date, while elapsed time is based on the exact timestamp.
Date-Based Study Day
A common date-based convention numbers the origin date as Study Day 1, assigns subsequent calendar dates consecutive positive integers, and assigns dates before the origin negative integers. Under this convention, there is no Study Day 0. It is useful when the analysis or reporting convention is based on calendar dates rather than exact 24-hour intervals.
The date differences in this formula are integer counts of calendar days. The offset of \(+1\) makes the origin date Day 1; the predose branch does not add 1, so the calendar date immediately before the origin is Day -1. Apply the rule to dates in the protocol’s specified calendar-time basis. A record’s time of day does not change its date-based study day.
Worked Example: Counting Across the Origin Date
In a hypothetical study, a subject’s origin date is April 5, 2026. Records have dates April 4, April 5, April 6, and April 8. Assign date-based study days using the convention above.
April 4 is one calendar day before the origin, so its study day is \(4 - 5 = -1\). April 5 is the origin date, so its study day is \((5 - 5) + 1 = 1\). April 6 is one day after the origin, so its study day is \((6 - 5) + 1 = 2\). April 8 is three days after the origin, so its study day is \((8 - 5) + 1 = 4\).
The assigned values are therefore -1, 1, 2, and 4. There is no Study Day 0. Because these records are date-only, this calculation does not determine whether any record occurred before or after a particular clock time on its date.
Elapsed-Time Day Indices and Day Zero
An alternative is to create day labels from exact elapsed time. For a one-based convention, define Study Day 1 as the first 24-hour interval beginning at the origin: elapsed times from 0 hours up to, but not including, 24 hours belong to Day 1. The next interval, from 24 hours up to but not including 48 hours, is Day 2. Under this convention, times before the origin fall into Day 0 or earlier.
The floor function returns the greatest integer less than or equal to its argument. To justify the formula, the interval for index \(k\) is defined by \(24(k-1) \leq t < 24k\) hours. Dividing by 24 hours gives \(k-1 \leq t/(24\ \text{hours}) < k\). The greatest integer less than or equal to \(t/(24\ \text{hours})\) is therefore \(k-1\), so \(k = \lfloor t/(24\ \text{hours}) \rfloor + 1\). The same formula also handles negative times: an event less than 24 hours before the origin has index 0.
A different elapsed-time convention numbers the origin’s interval as Day 0. Its index is \(\lfloor t/(24\ \text{hours}) \rfloor\). This is not a calculation error; it is a different labeling rule. For instance, at \(t=0\), the one-based rule gives Day 1 and the zero-based rule gives Day 0. Never combine these labels in one field without an explicit conversion rule.
Worked Example: A Midnight Crossing in Less Than One Day
Suppose a hypothetical subject’s exact origin is September 14, 2026, at 23:30. A record occurs September 15 at 00:15, just after midnight. Calculate its elapsed time, its date-based study day, and its one-based elapsed-time day index.
The elapsed time is 45 minutes, or \(0.75\) hours. The record falls on the calendar date after the origin date, so date-based study day is \((1) + 1 = 2\). For the elapsed-time index, \(\lfloor 0.75/24 \rfloor + 1 = \lfloor 0.03125 \rfloor + 1 = 1\). Thus this record is Study Day 2 by the date-based convention but elapsed-time Day 1 by the one-based 24-hour convention.
The difference arises because the calendar date changed after only 45 minutes. It shows why a study-day value cannot be interpreted as an elapsed duration unless its convention is known.
Choosing and Checking a Convention
Use the convention specified by the study or analysis definition. If an output needs both calendar-based study day and elapsed time, calculate and label them separately. In data specifications and analysis code, names such as “calendar study day” and “elapsed hours from origin” make the distinction clearer than an unqualified “day” field.
State what defines the origin for each subject, and which timestamp or date is used when the event is represented more than one way.
Determine whether event and origin values include times, and ensure timestamps can be compared on a common time basis. Do not infer exact elapsed time from date-only data.
Specify whether the origin date is Day 1, whether Day 0 exists, and whether day intervals follow calendar dates or exact 24-hour periods.
Check a predose record, a record exactly at the origin, a record just before and just after midnight, and one at an exact 24-hour boundary.
Boundary checks often reveal a hidden convention mismatch. For the one-based elapsed-time rule, \(t=23.999\) hours is Day 1 and \(t=24\) hours is Day 2. For date-based study day, a record just after midnight may already be the next study day, even when it is only minutes after the origin. Also check records before the origin: a predose value can be negative elapsed time, a negative date-based study day, or elapsed-time Day 0 under the one-based interval rule, depending on its timing and the selected definition.
Calendar days and 24-hour intervals also behave differently around daylight-saving transitions if local clock times are used. A local calendar date can be 23 or 25 hours long. For exact elapsed durations, subtract timestamps representing comparable instants; for date-based study day, use the protocol’s calendar-date rule. Do not assume that every change of calendar date represents exactly 24 elapsed hours.
Common Mistakes and Limitations
- Calling every day label elapsed time. Study Day 2 can begin at midnight under a date-based rule or at 24 hours after the origin under an elapsed-time rule. State which one is meant.
- Assuming that a predose record must be on a negative study day. A predose record on the origin date is Study Day 1 under the stated date-based convention, although its elapsed time can be negative.
- Adding one to every date difference. Under a convention with no Day 0, dates before the origin use the negative date difference without the \(+1\); otherwise the day labels shift incorrectly.
- Inventing a time for a date-only value. A date alone cannot establish whether a record was before or after an origin time on the same date.
- Using different origins or time bases without documenting them. A correct subtraction with the wrong subject-specific origin, or with incompatible timestamp bases, produces an incorrect relative time.
The methods have complementary strengths. Date-based study day can be calculated from dates and supports calendar-oriented summaries, but it cannot represent within-day timing and need not correspond to a 24-hour exposure interval. Exact elapsed time preserves the timing of partial days and predose records, but requires sufficiently precise timestamps and a defined time basis. An integer elapsed-time day index simplifies grouping but discards the exact elapsed time; retain the continuous elapsed-time value when timing within an interval matters.
Check Your Understanding
Answer each question using the convention stated in the question. Solutions follow the questions.
- A subject’s origin is June 2 at 10:00. What is elapsed time in hours for a record at June 2, 09:15?
- Under the date-based convention with origin date Study Day 1 and no Day 0, what study day is the calendar date immediately before the origin?
- Under the one-based elapsed-time day-index rule, what day index corresponds to \(t=48\) hours?
- An origin occurs at 23:50 and a record occurs at 00:10 the next date. Which value is smaller: elapsed time or date-based study day? Explain why they cannot be directly compared as durations.
- Why can date-only data support a date-based study day but not an exact elapsed time from an origin recorded at a particular hour?
Solutions. (1) The record is 45 minutes before the origin, so elapsed time is \(-0.75\) hours. (2) It is Study Day -1, because the date difference is -1 and the predose branch does not add 1. (3) \(\lfloor 48/24 \rfloor + 1 = 3\), so the index is Day 3; the interval begins at 48 hours. (4) Elapsed time is 20 minutes, or \(1/3\) hour, while the date-based study day is 2. The record crosses midnight quickly, so the calendar day label changes even though little time has elapsed; the quantities use different scales and meanings. (5) A date-only value has no time of day, so the exact timestamp difference cannot be determined without adding unsupported timing information.