I have a below code written in js activity. I need to add 1 hour to the variable currDate. How can I do that? I tried with setHour() and + operator without luck.
vars.currDate = new Date();
logInfo("vars.currDate----------" + vars.currDate);
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hello @RajeshBhat This is how the setHours will work.
var now = new Date();
logInfo("Current Date: "+ now.toISOString());
now.setHours(now.getHours() + 1);
logInfo("New time (1 hour ahead): " + now.toISOString());
Views
Replies
Total Likes
Hello @RajeshBhat This is how the setHours will work.
var now = new Date();
logInfo("Current Date: "+ now.toISOString());
now.setHours(now.getHours() + 1);
logInfo("New time (1 hour ahead): " + now.toISOString());
Views
Replies
Total Likes
Thanks @_Manoj_Kumar_ , that worked!
Views
Replies
Total Likes