PDF In-Depth

JavaScript - Displaying the Date

February 16, 2000


How to display the date using JavaScript.

  1. Create a text field using the form tool.
  2. Click the format tab and select an appropriate date format.
  3. Click the calculate tab and select custom and enter the following:

  event.value = util.printd("mm/dd/yyyy", new Date());

If you want the field only to be populated once (for example, the first time the form is opened or reset but not subsequently) you can modify the script slightly:

if (event.value == "")

  event.value = util.printd("mm/dd/yyyy");
PDF In-Depth Free Product Trials Ubiquitous PDF

Debenu Quick PDF Library

Get products to market faster with this amazing PDF developer SDK. Over 900 functions and an equally...

Download free demo

Five visions of a PDF Day

In the world of PDFs or as we like to say Planet (of) PDF, a year isn't a real PDF year without an intense few days of industry knowledge sharing.

May 15, 2018
Platinum Sponsor

Search Planet PDF
more searching options...
Planet PDF Newsletter
Most Popular Articles
Featured Product

Debenu PDF Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link control. Take Acrobat to the next level.


Adding a PDF Stamp Comment

OK, so you want to stamp your document. Maybe you need to give reviewers some advice about the document's status or sensitivity. This tip from author Ted Padova demonstrates how to add stamps with the Stamp Tool along with related comments.