Introduction:
- 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.
Step-by-Step Instructions:
Step 1: Simply create a text field called ‘timestamp’
Step 2: And then copy/paste this code into a node script
<script>
var Time = new Date().toLocaleString("en-US", {timeZone: "America/New_York"});
Time = new Date(Time);
var date = Time.getFullYear()+'-'+(Time.getMonth()+1)+'-'+Time.getDate();
var time = Time.getHours() + ":" + Time.getMinutes() + ":" + Time.getSeconds();
var timestamp = date+'-'+time;
console.log(timestamp)
DT.setField('timestamp', timestamp);
</script>
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)