Skip to main content

Merge tag {yesterday}

Yesterday. Exactly 24 hours before now, date and time. It is not midnight yesterday.

On the test entry, {yesterday} gives January 14, 2026.

ProductGravityView
RequiresGravityView 2.30 or later
Needs an entryNo

Modifiers

What to show

ModifierDescriptionRequires
diffTime difference from now. Renders "3 days ago" for past dates and "3 days from now" for future ones. Before GravityView 3.5 it was off by the site's time-zone offset.GravityView 2.30 or later
no_tz_offsetSkip the timezone offset. Returns UTC from GravityView 3.4. Earlier versions returned the wrong time.GravityView 2.33 or later
rawRaw stored date. GravityView 2.30 or later
timestampUnix timestamp. On these tags, the timestamp is the site's local time shifted by its time-zone offset, not a true UTC timestamp (unlike {today:timestamp}).GravityView 2.30 or later

Change the output

ModifierDescriptionRequires
formatCustom date format. A PHP date() format. Everything after format: is the format, so put it last. Write a colon as \:. See PHP's table of date format letters. A comma needs no backslash here; \, also works.GravityView 2.30 or later

Other settings

ModifierDescriptionRequires
timeInclude the time. GravityView 2.30 or later

Examples

Output from the real plugin code, run on a test entry.

Merge tagOutput
{yesterday}January 14, 2026

With a modifier

Merge tagOutputWithout the modifier
{yesterday:raw}2026-01-14 09:00:00January 14, 2026
{yesterday:timestamp}1768363200January 14, 2026
{yesterday:diff}1 day agoJanuary 14, 2026
{yesterday:time}January 14, 2026 at 4:00 amJanuary 14, 2026
{yesterday:format:Y-m-d}2026-01-14January 14, 2026