Hi, still getting my head around Java and RB. Seems to be a lot of ways to do the one thing. I would like to use RB to generate Java code to give me a new date from a known date and a duration.
What I tried is:
{!return_DT} = {!startDate} + {!duration}
001 Fri Oct 10 2014 16:00:00 (EST) = Tue Nov 25 2014 19:44:00 (EST) + 23400000
Formula return type: Date/Time (Adjust to user time zone)
Error missing ; before statement (line #1) in formula: Fri Oct 10 2014 16:00:00 (EST) = Tue Nov 25 2014 19:44:00 (EST) + 23400000
Any help most gratefully accepted.
Hello,
Can you provide the steps you are doing in Rollbase? Are you referring to JAVA or Javascript?
Thank you,
Gian
Flag this post as spam/abuse.
Hi Gian, javascript.
Thanks
Gil
Hello,
You can parse the token return into a date as Ricardo has posted. You can also add the duration by converting the duration into milliseconds.
var date = new Date("{!date_token}");
date = new Date(date.setHours(0,0,0,0)); /*sets the date to 12:00 am*/
date = date.setMilliseconds(10000); /*sets the time of the date variable*/
return date;
Thank you,
Gian