Skip to main content

mbr_date

Usage

This shortcode returns a specified date formatted and modified as requested.

The specified date can be:

  • The current date.
  • Any date formatted according to the the syntax rules set for PHP as detailed within date formats.
  • Any ActiveCampaign contact date field. Most ActiveCampaign date fields are properly formatted and will function correctly. See [mbr_contact] for information upon how to reference ActiveCamapign contact fields.

Parameters

ParametersDescription
dateThe specified date must provide a value that follows the syntax rules set for PHP as detailed within date formats. Most ActiveCampaign date fields are properly formatted and will work.
Default: The current date.
Required: yes.
operationAny text operator that follows the syntax rules as detailed for PHP strtotime(). This will modify the specified date.
Default: none.
Required: no.
formatThe desired format for the returned date. The format must follow the syntax rules set for PHP as detailed within date formats.
Default: F jS, Y
Required: no.

Validity

This shortcode is evaluated for any type of visitor.

Conditional Branching

This shortcode does NOT support conditional branching with [ELSE_date].

Nesting

Shortcode nesting within is NOT supported.

Examples

Returns today's date formatted as per this example November 1st, 2021:

[mbr_date format='F jS, Y']

API

For direct use in PHP code use the function mbr_date() in a structure as illustrated here:

$my_date = mbr_date( array( 'date'=>'20091205123456', 'format'=>'F jS, Y', 'operation'=>'+3 months') );