I need the number of days between two dates in PDF form (2024)

Adobe Community

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Showonly | Search instead for

Did you mean:

  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ

    Dedicated community for Japanese speakers

  • 한국 커뮤니티

    Dedicated community for Korean speakers

Exit

  • Home
  • Acrobat
  • Discussions
  • I need the number of days between two dates in PDF...
    • Home
    • Acrobat
    • Discussions
  • I need the number of days between two dates in PDF...

I need the number of days between two dates in PDF form (3)

New Here ,

/t5/acrobat-discussions/i-need-the-number-of-days-between-two-dates-in-pdf-form/td-p/14854772 Sep 11, 2024 Sep 11, 2024

Copy link to clipboard

Copied

Have attempted to generate the number of days between two dates using a custom calculation in a text field form and no matter what formula I use the field blank.

Can anyone help?

TOPICS

Create PDFs , JavaScript , PDF , PDF forms

Views

85

Translate

Translate

Report

Report

  • Follow
  • Report

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

I need the number of days between two dates in PDF form (4)

    I need the number of days between two dates in PDF form (5) 2 Correct answers

    Nesa Nurani Community Expert , Sep 11, 2024 Sep 11, 2024

    I assume you have two dates fields and want to show number of days in 3rd field, let's say two dates fields are named "Date1" and "Date2", use this as custom calculation script of 3rd field:

    var date1 = this.getField("Date1").valueAsString;var date2 = this.getField("Date2").valueAsString;if (date1 && date2) { var d1 = new Date(date1); var d2 = new Date(date2); var diffInMs = d2.getTime() - d1.getTime(); var diffInDays = diffInMs / (1000 * 60 * 60 * 24); event.value = diffInDays.toFix

    ...

    Votes

    1 Upvote

    Translate

    Translate

    Jump to answer

    I need the number of days between two dates in PDF form (9) I need the number of days between two dates in PDF form (10)

    Community Expert , Sep 11, 2024 Sep 11, 2024

    Nesa Nurani Community Expert , Sep 11, 2024 Sep 11, 2024

    Here you go:

    var date1 = this.getField("Date1").valueAsString;var date2 = this.getField("Date2").valueAsString;if (date1 && date2) { var d1 = new Date(date1); var d2 = new Date(date2); var year1 = d1.getFullYear(); var year2 = d2.getFullYear(); var month1 = d1.getMonth(); var month2 = d2.getMonth(); var diffInMonths = (year2 - year1) * 12 + (month2 - month1); event.value = diffInMonths;} else { event.value = "";}

    Votes

    Upvote

    Translate

    Translate

    Jump to answer

    I need the number of days between two dates in PDF form (12) 4 Replies 4

    Jump to latest reply

    I need the number of days between two dates in PDF form (15) I need the number of days between two dates in PDF form (16)

    Community Expert ,

    /t5/acrobat-discussions/i-need-the-number-of-days-between-two-dates-in-pdf-form/m-p/14854845#M478394 Sep 11, 2024 Sep 11, 2024

    Copy link to clipboard

    Copied

    I assume you have two dates fields and want to show number of days in 3rd field, let's say two dates fields are named "Date1" and "Date2", use this as custom calculation script of 3rd field:

    var date1 = this.getField("Date1").valueAsString;var date2 = this.getField("Date2").valueAsString;if (date1 && date2) { var d1 = new Date(date1); var d2 = new Date(date2); var diffInMs = d2.getTime() - d1.getTime(); var diffInDays = diffInMs / (1000 * 60 * 60 * 24); event.value = diffInDays.toFixed(0);} else { event.value = "";}

    Votes

    1 Upvote

    Translate

    Translate

    Report

    Report

    • Follow
    • Report

    Community guidelines

    Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

    I need the number of days between two dates in PDF form (18)

    I need the number of days between two dates in PDF form (19)

    New Here ,

    /t5/acrobat-discussions/i-need-the-number-of-days-between-two-dates-in-pdf-form/m-p/14855113#M478418 Sep 11, 2024 Sep 11, 2024

    Copy link to clipboard

    Copied

    In Response To Nesa Nurani

    Perfect it works!

    Is there a Java script to count months between two dates.

    Votes

    Upvote

    Translate

    Translate

    Report

    Report

    • Follow
    • Report

    Community guidelines

    Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

    I need the number of days between two dates in PDF form (20)

    I need the number of days between two dates in PDF form (21) I need the number of days between two dates in PDF form (22)

    Community Expert ,

    /t5/acrobat-discussions/i-need-the-number-of-days-between-two-dates-in-pdf-form/m-p/14855531#M478439 Sep 11, 2024 Sep 11, 2024

    Copy link to clipboard

    Copied

    In Response To Jerry_Owens4329

    Here you go:

    var date1 = this.getField("Date1").valueAsString;var date2 = this.getField("Date2").valueAsString;if (date1 && date2) { var d1 = new Date(date1); var d2 = new Date(date2); var year1 = d1.getFullYear(); var year2 = d2.getFullYear(); var month1 = d1.getMonth(); var month2 = d2.getMonth(); var diffInMonths = (year2 - year1) * 12 + (month2 - month1); event.value = diffInMonths;} else { event.value = "";}

    Votes

    Upvote

    Translate

    Translate

    Report

    Report

    • Follow
    • Report

    Community guidelines

    Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

    I need the number of days between two dates in PDF form (24)

    I need the number of days between two dates in PDF form (25)

    New Here ,

    /t5/acrobat-discussions/i-need-the-number-of-days-between-two-dates-in-pdf-form/m-p/14856216#M478486 Sep 12, 2024 Sep 12, 2024

    Copy link to clipboard

    Copied

    LATEST

    In Response To Nesa Nurani

    Thank you so much!

    Votes

    Upvote

    Translate

    Translate

    Report

    Report

    • Follow
    • Report

    Community guidelines

    Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

    I need the number of days between two dates in PDF form (26)

    I need the number of days between two dates in PDF form (27)

    I need the number of days between two dates in PDF form (28)

    Resources

    About Adobe Acrobat

    Adobe Inc

    Whats new in Acrobat DC

    Adobe Inc

    Plan and Pricing

    Adobe Inc

    Adobe Acrobat features and tools

    Adobe Inc

    Adobe Acrobat Feature & Workflow

    Edit PDFs

    Edit Scanned PDFs

    PDF Forms

    Sign a PDF

    FAQs

    How to Edit Scanned or Secured document

    Rotate | move | delete and renumber PDF pages

    Acrobat download and installation help

    Copyright © 2024 Adobe. All rights reserved.

    Using the Community Experience League Terms of Use Privacy Cookie preferences Do not sell or share my personal information AdChoices

    I need the number of days between two dates in PDF form (2024)

    FAQs

    How to calculate the number of days between two dates? ›

    To calculate the number of days between two dates, you need to subtract the start date from the end date.

    What function returns the number of days between two dates? ›

    Many people use the DAYS function when calculating the number of days between two dates, as this function is based on a 365-day year. You may also use the DAYS360 function that performs the same calculation but bases it on a 360-day year.

    How to get Excel to calculate the number of days between two dates? ›

    To find the number of days between these two dates, you can enter “=B2-B1” (without the quotes into cell B3). Once you hit enter, Excel will automatically calculate the number of days between the two dates entered.

    Which formula can be used to find the days between two dates? ›

    The DAYS function in Excel is a formula designed to compute the count of days between two given dates. The syntax for the function is “=DAYS(end_date, start_date).” Therefore, the end date is specified as the first argument in the formula, and the start date is specified as the second argument in the formula.

    What is the formula to count time between dates? ›

    The obvious method I have seen with various trainees is to subtract the date of joining from the specified end date and then divide the resultant value by 365 (or 360 for other regions) as shown below.

    How do I calculate the number of days between two dates in sheets? ›

    Each function designed to calculate days between dates in Google Sheets has unique characteristics: DAYS function: Computes the difference between two dates. Simple syntax: =DAYS(end date, start date). DATEDIF function: Offers more detailed results, such as the difference in days, months, or years.

    What is the formula for number of workdays between two dates in Excel? ›

    =NETWORKDAYS(start_date, end_date, [holidays])

    The function uses the following arguments: Start_date (required argument) – Start_date can either be earlier than end_date, later than end_date, or same as end_date. End_date (required argument) – The end date.

    What is the formula for the average number of days between two dates in Excel? ›

    so your formula would look something like this =(SUM(D:D)-SUM(A:A))/COUNTIF(D:D,">0") where you just subtract the start date from the completed date and divide by the number of dates.

    Is there a way to calculate the number of days between two dates? ›

    To calculate the time between two dates and times, you can simply subtract one from the other.

    How to calculate day from date? ›

    How to Find the Day of the Week for Any Date
    1. Take the last two digits of the year.
    2. Add to that one–quarter of those two digits (discard any remainder).
    3. Add to that the day of the month and the Month Key number for that month: Read Next. When Is Easter 2025? ...
    4. Divide the sum by 7. The remainder is the day of the week!
    Aug 1, 2024

    How do you count the number of items between two dates in Excel? ›

    A quick and easy way to count between dates is by using the COUNTIFS formula.

    How to calculate number of workdays between two dates in Excel? ›

    =NETWORKDAYS(start_date, end_date, [holidays])

    The function uses the following arguments: Start_date (required argument) – Start_date can either be earlier than end_date, later than end_date, or same as end_date. End_date (required argument) – The end date.

    How do you calculate the number of days between two periods? ›

    The average menstrual cycle is about 28 days. This means that about 28 days pass between the first day of your period and the first day of your next period. Not everyone has this textbook cycle, though. You may find that your periods typically occur every 21 to 35 days.

    References

    Top Articles
    Latest Posts
    Article information

    Author: Gregorio Kreiger

    Last Updated:

    Views: 5788

    Rating: 4.7 / 5 (57 voted)

    Reviews: 80% of readers found this page helpful

    Author information

    Name: Gregorio Kreiger

    Birthday: 1994-12-18

    Address: 89212 Tracey Ramp, Sunside, MT 08453-0951

    Phone: +9014805370218

    Job: Customer Designer

    Hobby: Mountain biking, Orienteering, Hiking, Sewing, Backpacking, Mushroom hunting, Backpacking

    Introduction: My name is Gregorio Kreiger, I am a tender, brainy, enthusiastic, combative, agreeable, gentle, gentle person who loves writing and wants to share my knowledge and understanding with you.