Date attribute formats

Learn what formats we accept when sending a user attribute as a date.

Muhammet avatar
Written by Muhammet
Updated over a week ago

Overview

When sending user attributes to UserGuiding, a common use case is to send dates, such as sign-up, subscription, cancellation dates, and many others.

With these attributes, you could display a Survey to users who subscribed two weeks ago or show a Guide to newly subscribed users, for example.

Accepted formats

Please use one of the following formats when sending dates as user attributes.

If the attribute name is created in the format *_at (for example, subscribed_at or created_at), the attribute will already be perceived as a date.

//Sends date in YYYY/MM/DD format (most recommended since it is a
user-friendly format)

window.userGuiding.identify({
subscribed_at : "2022/01/25"
});


//Sends date in Unix Epoch format (milliseconds)

window.userGuiding.identify({
subscribed_at: 1626449677000
});


//Sends date in ISO format (there needs to be 'T' between date and time)

window.userGuiding.identify({
subscribed_at: "2022-01-25T15:00:00.008684+00:00"

//or without milliseconds/timezone

subscribed_at: "2022-01-25T15:00:00"
});
Did this answer your question?