Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8528015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:42:30+00:00 2026-06-11T08:42:30+00:00

I am trying to validate input date fields, and I want to make sure

  • 0

I am trying to validate input date fields, and I want to make sure that the entires are no more than 90 days difference from each other.
Could anyone offer any solutions to the function I need to be using here.
Below is my psuedocode of what I want to achieve.

if (($filter_in['dt']-90) > ($filter_in['df']));

The -90 bit is where I need to minus 90 days from the end date. Is it possible to go about this in this approach?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T08:42:31+00:00Added an answer on June 11, 2026 at 8:42 am

    Do like this

    <?php
    $datetime1 = new DateTime('2012-10-11');
    $datetime2 = new DateTime('2012-09-13');
    $interval = $datetime2->diff($datetime1);
    $diff= $interval->format('%R%a');
    if($diff=="+90"){
       //your code
    }
    ?> 
    

    or in above code you can just format like this

    $diff= $interval->format('%a');
    

    or simply like @vascowhite said

    $diff= $interval->days;
    

    to get a positive integer only, the above code returns 28 which is in days.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to validate input fields when the value is empty. I want to
I'm trying to validate an input field by making sure that only text, spaces
I’m trying to validate input by using egrep and regex.Here is the line from
Right what I was trying to do is validate some input so that the
I'm trying to validate that the input a user gives my program via gets
I'm trying to validate and get an interest rate from user input. I'm wanting
I am trying to validate a date input field. I can prevent jquery datepicker
I am trying to validate user input in WPF with Entlib 5.0. I want
I am trying to validate user input from a form before submit but it
i am trying to validate my form fields calling the input text ids, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.