How to Insert the Current UTC Time in an Acrobat PDF Form
Question details
The user needs to configure an Acrobat form button to insert the current UTC time rather than the user's local system time.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Creating or modifying an interactive PDF form where standardized timestamping is required.
- Observed behavior
- A method or script is needed to fetch the exact UTC values and format them as a readable time string when a user interacts with a form field or button.
Ensure that your PDF editor supports JavaScript execution and that you have access to the form preparation or properties mode.
Use Acrobat JavaScript to Format and Insert UTC Time
You can add a custom JavaScript snippet to a button or text field to retrieve the current UTC hours, minutes, and seconds, then format it into a standard time string.
By default, standard JavaScript date objects pull the local time from the user's operating system. To strictly capture UTC time, you must use the getUTC methods.
The util.printf function in Acrobat is excellent for ensuring single-digit minutes or seconds are correctly padded with a leading zero.
Launch your PDF document in Adobe Acrobat, go to the Tools menu, and select 'Prepare Form'.
Right-click the target button or text field where you want the time to appear, and choose 'Properties' from the context menu.
Click on the 'Actions' tab (for a button) or the 'Calculate' tab (for an automated text field).
Under 'Select Action', choose 'Run a JavaScript', and click the 'Add' button.
Paste the following script into the editor: var now = new Date(); var time = util.printf("%02d:%02d:%02d", now.getUTCHours(), now.getUTCMinutes(), now.getUTCSeconds()); event.value = time; Then, click OK.
Close the properties dialog, exit the form editing mode, and click your button to verify that the correct UTC time populates the field.

A Complete PDF Editing Solution
WPS Office offers a robust built-in PDF editor that allows you to open, interact with, and fill out PDF forms smoothly. It serves as a powerful, lightweight alternative to heavy PDF applications.
- 1. Open WPS Office: Launch the WPS Office application and navigate to the PDF section.
- 2. Load Your PDF Form: Click 'Open' and select your interactive PDF form from your local files.
- 3. Interact and Fill: Click on the interactive fields or buttons to execute their scripts and fill in your required data.
- 4. Save Changes: Once completed, click 'Save' or press Ctrl+S to store the updated PDF safely on your device.

Frequently Asked Questions
Why does my PDF form show local time instead of UTC?
By default, basic PDF JavaScript functions like 'new Date()' retrieve the time directly from the user's local system clock. To capture UTC time, you must explicitly call methods such as 'getUTCHours()' and 'getUTCMinutes()'.
Can I include the current date along with the UTC time?
Yes. You can expand your JavaScript to include 'now.getUTCFullYear()', 'now.getUTCMonth() + 1' (months are zero-indexed), and 'now.getUTCDate()', then format them together with your time string.
Will this JavaScript work on mobile PDF readers?
Not all mobile PDF readers support JavaScript execution. For scripts to work reliably, users should open the form using a fully-featured desktop PDF application like Adobe Acrobat or WPS Office.




