1. Home
  2. Docs
  3. Personalization
  4. Reference
  5. Date and Time Functions

Date and Time Functions

These functions will take dates and times, and then format them according to your specifications. Dates, times, time zones, and daylight savings can cause headaches, so it’s important to understand how stored dates and time zone preferences affect how dates are formatted and presented.

  • Dates and times are stored in FeedBlitz as US eastern time.
  • FeedBlitz parses dates without time zone information (TLAs or offsets) as UTC.
  • If you present a date and time string to FeedBlitz, make it as unambiguous as possible.

Interpreting dates and times

  • “2025-07-24 15:18:02” is interpreted as 2 seconds after 3:18pm UTC on the 24th of July, 2025.
  • “2025-07-24 15:18:02 EDT” is interpreted as 2 seconds after 3:18pm US eastern daylight time on the 24th of July, 2025.
  • “2025-07-24 15:18:02 EDT” is interpreted as 2 seconds after 3:18pm, 4 hours behind UTC (so, possibly, US eastern daylight time) on the 24th of July, 2025.

Formatting dates and times

  • now returns the current date and time in the list owner’s preferred time zone in ISO 8601 format (“%Y-%m-%d %H:%M:%S %z”)
  • dateformatutc always returns the date and time in UTC.
  • dateformat uses the list owner’s account preference to determine the time zone to use when formatting the date string.

The date and time formatting functions take a time T and format it according to a format string, S.

Usage

  • now
  • dateformat(T,S)
  • T dateformat S
  • dateformatutc(T,S)
  • T dateformatutc S

Examples

  • “2025-07-24 15:18:02” dateformat “%A, %B %d, %Y, %i:%M:%S %p” gives “Thursday, July 24, 2025, 11:18:02 AM” for the US eastern time zone.
  • “2025-07-24 15:18:02 EDT” dateformatutc “%a, %b %d, %Y, %i:%M:%S %P” gives “Thu, Jul 24, 2025, 7:18:02 PM” – the UTC time.

So say you have a birth date (year, month, day) custom field “birthday” then this works:

  • <$if now dateformatutc(“%m”)=dateformatutc(birthday,”%m”) $> Birthday month gifts for you!<$endif$>

Important: We use dateformatutc in the above example, because a date without a time and no time zone information is assumed to be midnight, UTC. If you format the month using your preferences, which is what dateformat does, you may not get the expected results on the first day of the month. Consider, the US is behind UTC, so a date of “2025-08-01” is treated as “2025-08-01 00:00 UTC” which, for the US east coast, is “2025-07-31 20:00 EDT”, giving a month number of 7, not 8 as you might have expected / wanted.

Formatting Codes

CodeReplacement string
%aAbbreviated weekday name
%AFull weekday name
%bAbbreviated month name
%BFull month name
%cDate and time representation
%CThe year divided by 100 and truncated to an integer, as a decimal number (00−99)
%dDay of month as a decimal number (01 – 31)
%DEquivalent to %m/%d/%y
%eDay of month as a decimal number (1 – 31), where single digits are preceded by a space
%FEquivalent to %Y-%m-%d
%gThe last 2 digits of the ISO 8601 week-based year as a decimal number (00 – 99)
%GThe ISO 8601 week-based year as a decimal number
%hAbbreviated month name (equivalent to %b)
%HHour in 24-hour format (00 – 23)
%IHour in 12-hour format (01 – 12)
%jDay of the year as a decimal number (001 – 366)
%mMonth as a decimal number (01 – 12)
%MMinute as a decimal number (00 – 59)
%nA newline character (\n)
%pA.M./P.M. indicator for 12-hour clock
%rThe locale’s 12-hour clock time
%REquivalent to %H:%M
%SSecond as a decimal number (00 – 59)
%tA horizontal tab character (\t)
%TEquivalent to %H:%M:%S, the ISO 8601 time format
%uISO 8601 weekday as a decimal number (1 – 7; Monday is 1)
%UWeek number of the year as a decimal number (00 – 53), where the first Sunday is the first day of week 1
%VISO 8601 week number as a decimal number (00 – 53)
%wWeekday as a decimal number (0 – 6; Sunday is 0)
%WWeek number of the year as a decimal number (00 – 53), where the first Monday is the first day of week 1
%xDate representation
%XTime representation
%yYear without century, as decimal number (00 – 99)
%YYear with century, as decimal number
%zThe offset from UTC in ISO 8601 format; no characters if time zone is unknown
%ZThe time-zone name or time zone abbreviation; no characters if time zone is unknown
%%Percent sign