Timestamp Format
Complete reference for the temporal fragment syntax used in timestamp links, based on the W3C Media Fragments URI specification with Media Extended extensions.
The t= hash property uses the temporal fragment syntax from the W3C Media Fragments URI 1.0 specification, with a few Media Extended extensions. This page documents the exact syntax accepted by the parser.
For an introduction to what timestamps are and how they appear in notes, see Timestamps and Time Links.
Syntax overview
A temporal fragment specifies one or two time values inside the hash of a media link:
[[lecture.mp4#t=<start>[,<end>]]]| Form | Meaning | Example |
|---|---|---|
t=<start> | Seek to <start>, play to end of media | #t=01:30 |
t=<start>,<end> | Clip from <start> to <end> | #t=01:30,02:00 |
t=,<end> | Clip from beginning to <end> | #t=,02:00 |
t=<start>,e | Clip from <start> to end of media | #t=01:30,e |
<start> and <end> are written in Normal Play Time format. The e end sentinel is a Media Extended extension; it is not part of the W3C spec.
Normal Play Time
Time values follow the Normal Play Time (NPT) grammar from RFC 2326, which the W3C spec inherits. Three notations are accepted.
| Notation | Pattern | Example | Resolves to |
|---|---|---|---|
| Seconds | S or S.fff | 95, 12.5 | 95 s, 12.5 s |
| MM:SS | MM:SS or MM:SS.fff | 01:35 | 95 s |
| HH:MM:SS | HH:MM:SS or HH:MM:SS.fff | 1:02:30 | 3,750 s |
Format rules:
MMandSSmust be exactly two digits (00–59).1:35is not valid; write01:35.HHcan be any number of digits.- Fractional seconds are optional in any notation and may have any number of decimal places.
- Negative time values are not valid.
- An optional
npt:prefix is accepted on either time value:t=npt:01:30,npt:02:00is equivalent tot=01:30,02:00.
Validation rules
When the parser cannot resolve a temporal fragment to a valid range, it silently ignores the fragment and the player loads the media without seeking.
<start>must be less than<end>when both are explicitly specified.t=20,10is rejected.- A bare
t=with no value is rejected. - Time strings that don't match one of the three NPT notations are rejected.
Multiple t= properties
If a hash contains more than one t= property, the parser uses the last valid occurrence. Invalid occurrences are ignored.
| Input | Effective value |
|---|---|
t=10,20&t=30,40 | t=30,40 |
t=10,20&t=invalid | t=10,20 |
t=invalid&t=2,5&t=broken&t=10,20 | t=10,20 |
This matches the W3C spec's precedence rule for repeated dimensions.
Examples
| Hash | Behavior |
|---|---|
#t=10 | Seek to 10 s, play to end of media |
#t=10.5 | Seek to 10.5 s, play to end |
#t=01:35 | Seek to 1 m 35 s, play to end |
#t=1:02:30 | Seek to 1 h 2 m 30 s, play to end |
#t=10,20 | Clip 10 s–20 s |
#t=,30 | Clip 0 s–30 s |
#t=90,e | Clip 90 s–end of media |
#t=01:00,01:30&loop | Clip 60 s–90 s, looping |
#t=npt:10,20 | Same as #t=10,20 |
Differences from the W3C spec
Media Extended implements the temporal dimension of the W3C Media Fragments URI specification with the following changes.
| Feature | Status | Notes |
|---|---|---|
NPT format (t=10,20) | Supported | Default format. Optional npt: prefix accepted. |
SMPTE format (t=smpte:0:02:00) | Not supported | Frame-based time codes are not parsed. |
Wall-clock format (t=clock:...) | Not supported | Calendar timestamps are not parsed. |
Single-digit MM in MM:SS | Not supported | The W3C grammar allows 1:35; Media Extended requires 01:35. |
e end sentinel | Extension | Media Extended only. Use to make "play to end" explicit. |
| Last-occurrence precedence | Supported | Matches the W3C precedence rule for repeated dimensions. |
See also
- Timestamps and Time Links — what timestamps are and how to insert them
- Hash Properties — other hash properties you can chain with
t=(loop,mute,vol=, etc.) - W3C Media Fragments URI 1.0 — upstream specification
- RFC 2326 §3.6 — Normal Play Time definition