• Each lead is stamped with the ‘created at’ time stamp.
  • However, there is no way to call this field in your Decision Tree.
  • So let’s examine the case where you need to use your own time stamp custom field.
  1. Simply create a text field called ‘timestamp’
  2. And then copy/paste this code into a node script
var usaTime = new Date().toLocaleString("en-US", {timeZone: "America/New_York"});
usaTime = new Date(usaTime);
var date = usaTime.getFullYear()+'-'+(usaTime.getMonth()+1)+'-'+usaTime.getDate();
var time = usaTime.getHours() + ":" + usaTime.getMinutes() + ":" + usaTime.getSeconds();
var timestamp = date+'-'+time;

DT.setField('timestamp', timestamp);

You can get a list of supported time zones here: https://www.w3schools.com/php/php_ref_timezones.asp

Remember you need to publish and access via direct link/embed ( because scripts will not fire in preview ).

Leave a Reply

Your email address will not be published. Required fields are marked *