Back

This article describes how to use the date attribute.

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: Event, Visit and Visitor.

attribute-scopes-table-all.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

The Capture Date enrichment sets the attribute to the current timestamp at the time of an event condition. This enrichment is available for scopes: event, visit and visitor.

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

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 attribute. If the other attribute is a string, use the Date Formatter to convert it to a date. This enrichment is available for attributes: event, visit and visitor.

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. This enrichment is available for attributes: event, visit and visitor.

Attribute Name: Last Visit Date

Starting Value 1491233145706
Resulting Value ""

Format Date

The Format Date enrichment sets the value based on an expected date format of incoming values. It is used when neither a "TiQ Variable" nor native attribute type exists.

This enrichment is only available for event attributes.