Skip to main content
Participant
October 4, 2024
Question

How to solve "The Value entered does not match the format of the field xx"

  • October 4, 2024
  • 2 replies
  • 461 views

Hi! 

I'm trying to calculate for time differences between two time stamps. I have both values (FeederPtMarkingStart and FeederPtMarkingStop) in time format. 

When I put in the simple calculation: "FeederPtMarkingStop-FeederPtMarkingStart" into my "Surgeon_MarkingTime_Feeder1" text box I get the error "The Value Entered does not match the format of the field [Surgeon_MarkingTime_Feeder1] error. 

Is anyone able to help me solve? Thank you! 

This topic has been closed for replies.

2 replies

Thom Parker
Community Expert
Community Expert
October 4, 2024

So here's an article that covers the error you are getting:

https://www.pdfscripting.com/public/Value-Entered-Does-Not-Match-Format.cfm

 

However, as PDFAS states, dates are not like numbers.  Simple calculations do not work. 

Here are some articles about time:

https://www.pdfscripting.com/public/Date-and-Time-Handling.cfm

https://acrobatusers.com/tutorials/date_time_part1/

https://acrobatusers.com/tutorials/date_time_part2/

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
PDF Automation Station
Community Expert
Community Expert
October 4, 2024

You can't use a simplified field notation to find the different between 2 times unless some conversions are done.  What are the formats of the time stamp fields, the values, and what is the format of the Surgeon_MarkingTime_Feeder1 field?  Remove the formatting for the Surgeon_MarkingTime_Feeder1 field and see what the value is.

Participant
October 4, 2024

I set everything up for time value with HH:MM:ss as the format. 

Original test values were 08:30:00 and 09:00:00. 

The original format of Surgeon_MarkingTime_Feeder1 was HH:MM:ss as well but when I removed it and tried to solve with no format it told me "NaN."

PDF Automation Station
Community Expert
Community Expert
October 4, 2024

You are using the simplified field notation of subtraction.  It only works with 2 numbers.  08:30:00 is not a number (which is what NaN stands for).  You can't subtract time this way.  There are lots of answers on here about how to get the difference between two different times.  You're going to have to use a custom calculation script.