The JavaScript getTime() function is not being recognized in Date objects.
Error:
TypeError: Cannot find function getTime in object
Failed to execute code
Release : 4.4
Error in the Javascript code
Use the following approach to work with getTime() function
var d = new Date("2021-06-10T10:00:00Z");var gettime = d.getTime();Process.date1 = gettime
In addition, the following information will be helpful to work with dates:
//Date(year, month, day, hours, minutes, seconds, milliseconds);var d = new Date("2021-01-01T10:30:00Z");//The getDate() method returns the day of the month (from 1 to 31) for the specified date.var day = d.getDate();//Returns the day of the week (from 0-6)var weekday = d.getDay();// Returns the month (from 0-11)var month = d.getMonth();//Returns the yearvar year = d.getFullYear();// Returns the hour (from 0-23)var hour = d.getHours();//Returns the minutes (from 0-59)var minutes = d.getMinutes();//Returns the seconds (from 0-59)var seconds = d.getSeconds();// Returns the milliseconds (from 0-999)var milliseconds = d.getMilliseconds();//Returns the number of milliseconds since midnight Jan 1 1970, and a specified datevar gettime = d.getTime();//Returns the time difference between UTC time and local time, in minutesvar timezone = d.getTimezoneOffset();//Return the number of milliseconds between a specified date and midnight January 1 1970:var utc = Date.UTC(year, month+1, day);
Process.Date = d;Process.dayy = day;Process.month = month;Process.year = year;Process.hour = hour;Process.minutes = minutes;Process.seconds = seconds;Process.milliseconds = milliseconds;Process.weekday = weekday;Process.gettime = gettime;Process.timezone =timezone;Process.utc = utc;
Reference: