Adam Jenkins
Lead maintainer
The Timezone filter (filter_timezone) solves a constant nuisance in multi-timezone courses: an announced time is only correct for readers in the author's timezone. Together with the tiny_timezone editor plugin, which lets authors insert a date/time picked in their own timezone, this text filter makes every such time display correctly for every reader.
When a page is rendered, the filter finds the spans tiny_timezone inserted — each carries the exact Unix timestamp and the author's IANA timezone — and replaces the visible text with the same moment expressed in the viewing user's timezone, formatted with a site-configurable language-pack format string and labelled with the viewer's timezone name. Conversions use Moodle's own core_date and userdate() machinery, so daylight saving and half-hour offsets are handled exactly.
The filter is deliberately conservative and secure. It only rewrites spans whose content is exactly what the editor plugin wrote — anything an author typed around or inside the span is never discarded — and the replacement span is rebuilt from validated attributes only, so no attacker-controlled markup is ever reflected to other users. Disabled or uninstalled, pages degrade gracefully to the original text with its source timezone. Requires Moodle 5.0+; ships with PHPUnit tests and CI for Moodle 5.0–5.2.