Display the current date and time
When designing a form, you can use a text box, rich text box, or date picker to display the date and time that the form was first created. You can also use an expression box to show the current date and time, although this value will be updated each time the form is opened.
Note You should use an expression box only if you do not want to use the current date and time in another calculation or save the current date and time as part of the form, because expression boxes only display data and do not store it.
- In design mode, double-click the control where you want to display the current date and time.
- On the Data tab in the Control Properties dialog box, click Insert Formula .
- In the Insert Formula dialog box, click Insert Function.
- In the Categories list in the Insert Function dialog box, click Date and Time.
- In the Functions list, click now, and then click OK twice.
- On the Data tab in the Control Properties dialog box, clear the Update this value when the result of the formula is recalculated check box.
If the date and time do not display correctly, follow these steps:
- Double-click the control.
- On the Data tab in the Control Properties dialog box, click Date and Time in the Data type box or Format as box, and then click Format.
- In the Date Format dialog box, click the format that you want.
Note The information in this topic may not apply if you are working with a form designed using Microsoft Office InfoPath 2003 without the service pack installed. Learn more