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

[AEM Gems Webinar] Accelerating Experience Manager as a Cloud Service development with Rapid Development Environments

Time Formats


Not applicable
I would like to have the caption of a checkbox change from the text to the time that the box was checked.(Basically Time Stamp the Click Event) I've been able to get it to change to the milliseconds but have not been able to format this number to readable time.

The code that I'm using is this:

CheckBox1.caption.value.#text = Time()

I have tried to use the Num2Time function but all I get are error messages. I would appreciate any help that can be given.

2 Replies


Not applicable
In the check box's Click event, you can use the following script (make sure the language is set to

var oNow = new Date;

//this.caption.value.resolveNode("#text").value = oNow.toTimeString();

this.caption.value.resolveNode("#text").value = (oNow.getMonth() + 1) + "/" + oNow.getDate() + "/" + oNow.getFullYear() + " @ " + oNow.getHours() + ":" + oNow.getMinutes() + ":" + oNow.getSeconds();

The first method is commented-out in this example. Try it the way it is and then try commenting the third line and un-commenting the second one to see the difference.


Adobe Systems


Level 1

Is there a way to adapt that script to make a check box's background color change when the box is checked, i.e, white before being checked and grey after checked?