473,597 Members | 2,331 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.
Oct 22 '05 #1
2 2455
totoscarantino wrote:
hi guys..im a really noob fresh starting php programmer:P


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

--
E. Dronkert
Oct 22 '05 #2
"totoscarantino " <to************ @libero.it> wrote:

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:


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, ti**@probo.com
Providenza & Boekelheide, Inc.
Oct 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2737
by: adam | last post by:
Hi all, I am having a problem with calculating a date. What I am looking to do is get the date of Sunday of this week, then use mktime() to find out other days in the past by subtracting days. In the code below, today is Saturday, October 16, 2004, this week's Sunday is 2004-10-17. I successfully get that. But, when I try to subtract 7 days using mktime(), I instead of getting
1
17317
by: Raghu | last post by:
Hello... I am running into a problem while running a query..can some1 help.. this is the query : ************** SELECT * from Table S where S.dtDate1 BETWEEN dateadd(year,1,dateadd(month,-1,getdate())) AND dateadd(day,-1,(dateadd(month,1,dateadd(year,1,dateadd(month,-1,getdate()))))) *************** (first part of the date calculation comes out to be '2005-05-01' and
1
2074
by: mene | last post by:
I have a field that contains date information, and sometimes time information as well. I would like to be able to take that date and do a calculation on it. Here are some examples of what is in the field: 01/12/2003 5:04:00 PM 24/11/2003 19/05/2003 6:30:00 AM How can I take that date, then do a calculation like minus 5 days from the date. I understand that I am to use the GETDATE() function, but below is
4
5364
by: Richard Hollenbeck | last post by:
I'm trying to write some code that will convert any of the most popular standard date formats twice in to something like "dd Mmm yyyy" (i.e. 08 Jan 1908) and compare the first with the second and calculate days, months, and years. This is not for a college course. It's for my own personal genealogy website. I'm stumped about the code. I'm working on it but not making much progress. Is there any free code available anywhere? I know it...
1
1553
by: Greg | last post by:
I am using this calculation in a query to find invoices that are less then 30 days, over 30, over 60, over 90, and over 120. IIf((Now()-AR6_OpenInvoice1.INV_DATE)\30>4,4,(Now()-AR6_OpenInvoice1.INV_DAT E)\30); The problem is the invoice was created on let say 9/17/03 and is less then 30 days old but the calculation looks at it and says it is over 30. What do I need to fix this problem?
2
1376
by: David | last post by:
Hi, The data I am trying to print on the web looks as follows: Date 1 Record 1 Record 2 Record 3
4
15712
by: jamesyreid | last post by:
Hi, I'm really sorry to post this as I know it must have been asked countless times before, but I can't find an answer anywhere. Does anyone have a snippet of JavaScript code I could borrow which calculated the difference in years and days between two dates, and takes leap years into account? I'm calculating the difference in the usual way, i.e....
5
1106
by: jupiter | last post by:
hi friends, I am anil. I have begining level experience of c++ so I need ur advice. I have a problem for all think tanks in the group. what i want is 1. Access a web page (html) say ebay's page for particular item (I need to access different pages for several items approx. 1500) 2. Save that page in comp memory or on disk for processing 3. I am not sure if I can process that html in c++ or need to convert to txt first
1
2644
by: c8tz | last post by:
This is a query I have created that picks up the top 3 dates for this data (for example) : Tree Pos2 Date 1 15 23/08/2005 1 20 12/02/2006 1 32 15/10/2006 2 17 23/08/2005 2 18 12/02/2006
16
4444
by: W. eWatson | last post by:
Are there some date and time comparison functions that would compare, say, Is 10/05/05 later than 09/22/02? (or 02/09/22 format, yy/mm/dd) Is 02/11/07 the same as 02/11/07? Is 14:05:18 after 22:02:51? (24 hour day is fine) How about the date after 02/28/04 is 02/29/04, or the date after 09/30/08 is 10/01/08?
0
7884
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8267
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8258
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6681
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5844
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5423
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3880
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1493
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1229
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.