Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Auto calculate Dates?


Not applicable

I'm in the process of designing a new time sheet for our employees. We have a box where the two week period the sheet is for needs to be entered, along with rows for each day, showing the amount of hours worked. Is there a way for our user to input the day the time sheet starts on and it automatically fill out the ending date and fill in each individual box.

If I confused anyone, just let me know and I'll clarify to the best of my ability.

Thanks in advance,

2 Replies


Level 7
You have to use the Date/Time object and the "Date2Num()" and "Num2Date()" functions. The format of of the date string is very necessary and important because if you do not have it correct for the date string being passed to the 'Date2Num()" funciton you will not get a valid answer.

The "Date2Num()" funciton will convert a passed date into the number of days from the fixed Epoch Date of LiveCycle Designer, you can then add the number of days for the next date you want and use the "Num2Date()" funciton to convert the new number of days from the Epoch Date to a date string.


Level 1

Here is the code I use.

Use this code on the a text field.

Put the following code as Calculate in FormCalc(exclude the ------- divider):

----------beginning of the code-----------


(HasValue(xyz)) then

Num2Date( (Date2Num(xyz.formattedValue

, "MM/DD/YYYY") + ###), "MM/DD/YYYY")




--------ending of the code--------

=> Replace xyz with the field name, which your employee fills in

=> Replace ### with the number of days you want to add to

The ultimate experience is back.

Join us in Vegas to build skills, learn from the world's top brands, and be inspired.

Register Now