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

Automatically displaying date and time in a date/time field on form initialize

donn44157260
Level 5
Level 5

Good day all;

I am trying to have the current date and time automatically be generated in a “date/time” field when the form is opened.

I went through the forum and found an entry from Srini “ xfa.host.messageBox("" + Date());” . Of course this brought up a system message box with the date and time.

I then tried “DateTimeField1.rawValue = (“”+date())… This also gave me a system message box with the date and time…

Please let me know where I am going wrong

Chomp

1 Reply
donn44157260
Level 5
Level 5

Found the answer... And yes... in was in the "help" section... What can I say I was making it a lot more crazy than I needed to.

You can use a date/time field to automatically show the current date by using the Runtime Property option in the Value tab of the Object palette.

When using a current date field, the date updates to reflect the system’s current date each time a user opens the form.

1.

In the Library palette, click the Standard category and drag a Date/Time Field object onto the form design.

2.

In the Object palette, click the Value tab and select Calculated - Read Only from the Type list.

3.

Select the Runtime Property option.

4.

View the form in the Preview PDF tab.