How do I format a date in a token?

There are two ways to customize how dates appear in Powerbase:

Change the way a particular date is formatted in a particular template

In a template, if you are using a token that shows the date and time (such as {domain.now} or {contributions.date_received} or it could be any other token), you can change it to {domain.now |crmDate:"Full"} to get just the date. Note: in this example and the examples below, be sure to replace "domain.now" with the actual token with which you are working.

Here is a list of options for formating:

  • {domain.now|crmDate:"Datetime"}: September 18th, 2023 11:58 PM
  • {domain.now|crmDate:"Full"}: September 19th, 2023
  • {domain.now|crmDate:"shortdate"}: 09/18/2023
  • {domain.now|crmDate:"Partial"}: September 2023
  • {domain.now|crmDate:"Time"}: 1:34 PM
  • {domain.now|crmDate:"Year"}: 2023

Important

To use these tokens in a form with a rich text editor (aka CKEditor, aka WYSIWYG editor), you must configure the CKEditor to not convert the double quote character into the """ entity.

  1. Click Administer -> Cutomize Data and Screens -> Display Preferences
  2. Scroll down to the "Configure CKEditor 4" button and click that button
  3. Scroll down to advanced options
  4. Select "Basic Entities" from the drop down option and set to false

After making this change, you must clear the cache in your browser before the changes will take effect.

Change the way dates display by default throughout the database.

To change the date format throughout your database, click: Administer -> Localizations -> Date Format

You will seen a screen like the one below:

The letter codes are confusing! So here is a key:

  • %A - Full day name ('Saturday'..'Sunday')
  • %a - abbreviated day name ('Sat'..'Sun')
  • %b - abbreviated month name ('Jan'..'Dec')
  • %B - full month name ('January'..'December')
  • %d - day of the month as a decimal number, 0-padded ('01'..'31')
  • %e - day of the month as a decimal number, blank-padded (' 1'..'31')
  • %E - day of the month as a decimal number ('1'..'31')
  • %f - English ordinal suffix for the day of the month ('st', 'nd', 'rd', 'th')
  • %H - hour in 24-hour format, 0-padded ('00'..'23')
  • %I - hour in 12-hour format, 0-padded ('01'..'12')
  • %k - hour in 24-hour format, blank-padded (' 0'..'23')
  • %l - hour in 12-hour format, blank-padded (' 1'..'12')
  • %m - month as a decimal number, 0-padded ('01'..'12')
  • %M - minute, 0-padded ('00'..'60')
  • %p - lowercase ante/post meridiem ('am', 'pm')
  • %P - uppercase ante/post meridiem ('AM', 'PM')
  • %Y - year as a decimal number including the century ('2005')
Category: 
Admin Tasks
Email and Postal Mailings