• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Add 5 minutes to a time

New Here ,
Oct 21, 2020 Oct 21, 2020

Copy link to clipboard

Copied

I have a textbox that holds a time like "1:00 pm". I have another textbox below that I want to display 5 minutes added to the first box (1:05 pm). I've been looking through multiple forums trying different code, but the second text always displays "Invalid Date5". Here is the code I am using.

 

var dater = "1/1/2020" + " " + this.getField("Start1").value  

var previousDate = util.scand("m/d/yyyy h:MM tt", dater);

previousDate.changeBy({"minutes": 5});

event.value = util.printd("m/d/yyyy h:MM tt", previousDate);

I'm very basic in Javascript so any suggestions or help would be appreciated. Thank you! 

TOPICS
Acrobat SDK and JavaScript

Views

163

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation