• Simple question: I’ve enabled the user registration date, which is called visitorRegistrationDate in the data layer.

    The value of visitorRegistrationDate is a string that looks like 1512130332 or 1526601600 (for example).

    This value doesn’t look like a normal date/time format. What is the best way to view or convert this value to a recognizable date?

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi,

    This is a Unix timestamp that has wider opportunities of application.
    In order to convert this into a more readable text, you can create a data layer variable to read the content, let’s say you name this GTM variable as {{Visitor Registration Date}}

    Now you need to create a custom JS variable with this code:

    function() {
    return new Date( {{Visitor Registration Date}} * 1000 );
    }

    function() {
    return new Date( {{Visitor Registration Date}} * 1000 );
    }

    Not working function. object javascript variable empty

    • This reply was modified 3 years, 12 months ago by karnager.
    Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi @karnager,

    Please post a website URL so that I can check it as well.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Date format?’ is closed to new replies.