PDF Editing Issues

How to Insert the Current UTC Time in an Acrobat PDF Form

Algirdas JasaitisAlgirdas Jasaitis Nov 3, 2026 869 views

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.

How to Insert the Current UTC Time in an Acrobat PDF Form
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.
Before you start

Ensure that your PDF editor supports JavaScript execution and that you have access to the form preparation or properties mode.

Solution 1Recommended

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.

1
Open Prepare Form Mode

Launch your PDF document in Adobe Acrobat, go to the Tools menu, and select 'Prepare Form'.

2
Access Button or Field Properties

Right-click the target button or text field where you want the time to appear, and choose 'Properties' from the context menu.

3
Navigate to the Actions Tab

Click on the 'Actions' tab (for a button) or the 'Calculate' tab (for an automated text field).

4
Add a JavaScript Action

Under 'Select Action', choose 'Run a JavaScript', and click the 'Add' button.

5
Input the UTC Script

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.

6
Test the Form

Close the properties dialog, exit the form editing mode, and click your button to verify that the correct UTC time populates the field.

Use Acrobat JavaScript to Format and Insert UTC Time
Reusable Script: You can assign this exact script to multiple fields or buttons across your document wherever the UTC time is required.
Effortlessly Manage PDFs with WPS Office

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. 1. Open WPS Office: Launch the WPS Office application and navigate to the PDF section.
  2. 2. Load Your PDF Form: Click 'Open' and select your interactive PDF form from your local files.
  3. 3. Interact and Fill: Click on the interactive fields or buttons to execute their scripts and fill in your required data.
  4. 4. Save Changes: Once completed, click 'Save' or press Ctrl+S to store the updated PDF safely on your device.
Seamlessly open, fill, and save interactive PDF forms containing JavaScript.Highly compatible with Adobe Acrobat PDF formats and interactive elements.Lightweight and fast, perfect for everyday document management.Includes powerful tools for Word, Excel, PowerPoint, and PDF in a single integrated application.
microsoft office alternative - wps office

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.