Skip to main content

Modifier :timestamp

:timestamp does different things on different tags and fields:

  • Unix timestamp on {date_created}, {date_updated}, {payment_date}, and {today}, under What to show in the picker.
    Example: {date_created:timestamp} gives 1768438800.
  • Convert to a Unix timestamp on Date and Time fields, under Change the output in the picker.
    Example: {Start Date:128:timestamp} gives 1773878400. On the test form, this field is {Start Date:128} (Date).
  • Unix timestamp on {now}, {yesterday}, and {tomorrow}, under What to show in the picker.
    Example: {now:timestamp} gives 1768449600.

Unix timestamp

A true UTC timestamp on {today}. On the entry's dates it is the site's local time shifted by its time-zone offset, so it is off by that offset on a site not set to UTC.

ProductGravity Forms
RequiresGravity Forms 1.9 or later
In the pickerWhat to show, for {date_created}, {date_updated}, {payment_date}, and {today}

Examples

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

Merge tagOutputWithout the modifier
{date_created:timestamp}1768438800January 15, 2026
{date_updated:timestamp}1768439400January 15, 2026
{payment_date:timestamp}1768439100January 15, 2026
{today:timestamp}1768467600January 15, 2026
{date_created:timestamp}

Rendered against an entry nine days older, where the result differs.

1768276800January 15, 2026
{date_updated:timestamp}

Rendered against an entry nine days older, where the result differs.

1768277400January 15, 2026
{payment_date:timestamp}

Rendered against an entry nine days older, where the result differs.

1768277100January 15, 2026

Works on

Merge tags: {date_created} · {date_updated} · {payment_date} · {today}.

Convert to a Unix timestamp

Converts the value with PHP's strtotime(). Outputs -1 for a date at or before the start of 1970, or one PHP cannot read.

Works in any merge tag while GravityView is active, including Gravity Forms notifications.

ProductGravityView
RequiresGravityView 1.17 or later
In the pickerChange the output, for Date and Time fields

How to use it

Give a date to a script as a number

The date as a count of seconds (Unix time): easy to sort or compare in JavaScript.

Write

<time data-timestamp="{Birthday:13:timestamp}">{Birthday:13}</time>

Get

<time data-timestamp="294019200">04/27/1979</time>

Examples

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

Merge tagOutputWithout the modifier
{Birthday:13:timestamp}29401920004/27/1979

Works on

Form fields: Date · Time.

Left out

Field kindsWhy
Date, after a custom formatLocked there. "Custom date format" already reads the value as a date. A second date step would read its result instead of the field’s value and give a wrong date. Remove it first.

Unix 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}).

Works in any merge tag while GravityView is active, including Gravity Forms notifications.

ProductGravityView
RequiresGravityView 2.30 or later
In the pickerWhat to show, for {now}, {yesterday}, and {tomorrow}

Examples

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

Merge tagOutputWithout the modifier
{now:timestamp}1768449600January 15, 2026
{yesterday:timestamp}1768363200January 14, 2026
{tomorrow:timestamp}1768536000January 16, 2026

Works on

Merge tags: {now} · {yesterday} · {tomorrow}.