problem with date calculation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • totoscarantino

    problem with date calculation

    hi guys..im a really noob fresh starting php programmer:P

    but i need really to solve this problem witha php script:

    I can rent a flat from 01/01/90 to 01/01/2011
    ill rent that flat for a time that i will choice from that timeline above,
    so ie I could rent that flat from 01/15/93 to 01/15/95.

    well at this point i need to know how mani days for each year i rent that
    flat in the above case it would be like this:

    year 1990= 0
    year 1991=0
    year 1992=0
    year 1993 = 15
    year 1994=365
    year 1995=15
    year 1996=0
    year 199...
    year 2011=0

    since im really noob could plz give me:
    1)an input about the logic process to use to write a script
    2)wich command i should use
    3)a whole script or an idea of it if u can

    i know the days from and to each period, i cant just find the right routine
    to get the above datas

    thx in advance and sry for my crap english.


  • Ewoud Dronkert

    #2
    Re: problem with date calculation

    totoscarantino wrote:[color=blue]
    > hi guys..im a really noob fresh starting php programmer:P[/color]

    See http://php.net/manual/it/ref.datetime.php

    --
    E. Dronkert

    Comment

    • Tim Roberts

      #3
      Re: problem with date calculation

      "totoscarantino " <totoscarantino @libero.it> wrote:[color=blue]
      >
      >hi guys..im a really noob fresh starting php programmer:P
      >
      >but i need really to solve this problem witha php script:
      >
      >I can rent a flat from 01/01/90 to 01/01/2011
      >ill rent that flat for a time that i will choice from that timeline above,
      >so ie I could rent that flat from 01/15/93 to 01/15/95.
      >
      >well at this point i need to know how mani days for each year i rent that
      >flat in the above case it would be like this:[/color]

      This is homework, right? This newsgroup is not a free homework-solving
      service. Attack the problem yourself, show us what you've got, and we'll
      help you fix it.
      --
      - Tim Roberts, timr@probo.com
      Providenza & Boekelheide, Inc.

      Comment

      Working...