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
| Code | Replacement string |
|---|---|
%a | Abbreviated weekday name |
%A | Full weekday name |
%b | Abbreviated month name |
%B | Full month name |
%c | Date and time representation |
%C | The year divided by 100 and truncated to an integer, as a decimal number (00−99) |
%d | Day of month as a decimal number (01 – 31) |
%D | Equivalent to %m/%d/%y |
%e | Day of month as a decimal number (1 – 31), where single digits are preceded by a space |
%F | Equivalent to %Y-%m-%d |
%g | The last 2 digits of the ISO 8601 week-based year as a decimal number (00 – 99) |
%G | The ISO 8601 week-based year as a decimal number |
%h | Abbreviated month name (equivalent to %b) |
%H | Hour in 24-hour format (00 – 23) |
%I | Hour in 12-hour format (01 – 12) |
%j | Day of the year as a decimal number (001 – 366) |
%m | Month as a decimal number (01 – 12) |
%M | Minute as a decimal number (00 – 59) |
%n | A newline character (\n) |
%p | A.M./P.M. indicator for 12-hour clock |
%r | The locale’s 12-hour clock time |
%R | Equivalent to %H:%M |
%S | Second as a decimal number (00 – 59) |
%t | A horizontal tab character (\t) |
%T | Equivalent to %H:%M:%S, the ISO 8601 time format |
%u | ISO 8601 weekday as a decimal number (1 – 7; Monday is 1) |
%U | Week number of the year as a decimal number (00 – 53), where the first Sunday is the first day of week 1 |
%V | ISO 8601 week number as a decimal number (00 – 53) |
%w | Weekday as a decimal number (0 – 6; Sunday is 0) |
%W | Week number of the year as a decimal number (00 – 53), where the first Monday is the first day of week 1 |
%x | Date representation |
%X | Time representation |
%y | Year without century, as decimal number (00 – 99) |
%Y | Year with century, as decimal number |
%z | The offset from UTC in ISO 8601 format; no characters if time zone is unknown |
%Z | The time-zone name or time zone abbreviation; no characters if time zone is unknown |
%% | Percent sign |