This article describes the date attribute and how to use it in the Customer Data Hub product.

In this article:

Table of Contents Placeholder

How it Works

Before you begin, familiarize yourself with the following:

The date attribute stores the timestamp of an event, such as First Purchase Date, Last Checkout Date, or Last Visit date, in Unix/Epoch format, the time since January 1, 1970 (00:00:00).

The date attribute is available for the following scopes: Visit and Visitor.

Screenshot 2019-11-11 at 1.26.28 PM.png

Date Formatter

To convert a string attribute to a date, use the date formatter. Select the timestamp components from the date format panel that match the string values. For example, a string value such as "01/31/2020" can be converted to a date using a format of "MM/dd/yyyy".

Date and time string patterns:

G Era designator (before christ, after christ)
y Year (e.g. 12 or 2012). Use either yy or yyyy.
M Month in year. Number of M's determine length of format (e.g. MM, MMM or MMMMM)
d Day in month. Number of d's determine length of format (e.g. d or dd)
h Hour of day, 1-12 (AM / PM) (normally hh)
H Hour of day, 0-23 (normally HH)
m Minute in hour, 0-59 (normally mm)
s Second in minute, 0-59 (normally ss)
S Millisecond in second, 0-999 (normally SSS)
a AM / PM marker
z Time Zone
Z RFC 822 Time Zone
' Escape for text delimiter
' Single quote

Reference (with examples):
SimpleDateFormat Java Class

Date Enrichments

Capture Date

This enrichment sets the attribute to the current timestamp at the time of an event condition.  

For example, to capture the Last Purchase Date, use this enrichment with a rule that identifies your purchase events.

Attribute Name: Last Purchase Date

Starting Value ""
Enriched With  
Resulting Value 1491233145706

Set Date 

The Set Date enrichment sets the attribute to the value of another date attribute. If the other attribute is a string, use the Date Formatter to convert it to a date.

Attribute Name: Last Purchase Date

Starting Value ""
Enriched With 1491233145706
Resulting Value 1491233145706

Remove Date

The Remove Date enrichment erases the value of a date attribute.

Attribute Name: Last Visit Date

Starting Value 1491233145706
Resulting Value ""