COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### Date calculation

• Email
• Follow

`Hi there,I'm trying to build a function that can calculate, for a period until5 months, the specified date.For example, if i select today's date, 2nd October, the function mustreturn the following dates:November 6December 4January 1february 5I've check and in some month the date, is days, distance is 28 but inothers it is 35. What happens for this number variation? I've analyzedthe number of weeks in a month, the start and end weekday of the monthand the number of days in the month but i can't seem to discover whathappens to be 35 or 28.Any help will be usefull.Thanks in advance.Regards`
 0
Reply kubic62 (34) 10/2/2007 5:12:46 PM

See related articles to this posting

`On Oct 2, 7:12 pm, Pedro Pinto <kubi...@gmail.com> wrote:> I'm trying to build a function that can calculate, for a period until> 5 months, the specified date.> For example, if i select today's date, 2nd October, the function must> return the following dates:>> November 6> December 4> January 1> february 5>> I've check and in some month the date, is days, distance is 28 but in> others it is 35. What happens for this number variation? I've analyzed> the number of weeks in a month, the start and end weekday of the month> and the number of days in the month but i can't seem to discover what> happens to be 35 or 28.Would you have spent five seconds and looked at a real calendar (onepeople hang up at the wall), you would have recognized that the dateis in some way "rounded" to the same day of week. The dates are allTuesdays. I'll leave it up to you to figure out if the "rounding" isup, down, nearest or whatever, and if the calculation is always donefrom the start date, or each next calculated date serves as a freshstarting point. It's your homework, not ours.`
 0

`On Tue, 02 Oct 2007 10:12:46 -0700, Pedro Pinto <kubic62@gmail.com>wrote, quoted or indirectly quoted someone who said :>I'm trying to build a function that can calculate, for a period until>5 months, the specified date.>For example, if i select today's date, 2nd October, the function must>return the following dates:>>November 6>December 4>January 1>february 5this is the sort of thing BigDate does in its sleep.  It is bundledpart of http://mindprod.com/products1.html#COMMON11Look at the TestDate method which shows dozens of applications.-- Roedy Green Canadian Mind ProductsThe Java Glossaryhttp://mindprod.com`
 0

`In comp.lang.java.programmer message <1191345166.023670.315510@o80g2000hse.googlegroups.com>, Tue, 2 Oct 2007 10:12:46, Pedro Pinto<kubic62@gmail.com> posted:>>I'm trying to build a function that can calculate, for a period until>5 months, the specified date.The N'th X-day of the month is always the nearest X-day to the (7*N-3)thday of the month.The N'th X-day of the month always lies in the inclusive range from the(7*N-6)th to the (7*N)th of the month.--  (c) John Stockton, Surrey, UK.  ?@merlyn.demon.co.uk   Turnpike v6.05   IE 6. Web  <URL:http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see 00index.htm Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.`
 0

3 Replies
128 Views

Similar Articles

12/19/2013 2:11:28 AM
page loaded in 64150 ms. (0)

Similar Artilces:

Java Date class that performs date calculations?
I need some sample code that will: a) establish the current payment Date b)determine last payment Date and c) calculate the elasped days between the two dates. Any help would be appreciated! i dont believe anyone can answer a or b without first seeing the specifications. here is a starting point for c) http://scienceworld.wolfram.com/astronomy/GregorianCalendar.html wxwindows has some sample code but it is for c++. maybe someone can let you know a similar set of classes done in java like wxwindows. hope this helps, jim "GRR" <bat2win@hotmail.com> wrote in message news:...

Date calculator, add or subtract days to or from a given date
Here is the code so far <form name="thisform"> <h3>Enter time to add to or subtract from:</h3> (If not entered, current time will be used)<br> Day: <input name="d1" alt="Day of month" size=3> Month: <input name="m1" alt="Month" size=3> Year: <input name="y1" alt="Year" size=5> (4 digits for year, e.g. 1950)<br> Hours: <input name="h1" alt="Hours" size=3> Minutes: <input name="i1" alt="Minutes" size=3> Seconds: <input na...

Calculate the date after subtracting nmbr of days form a date
Hi, I'm currently adding a new module to an old borland C3.1 application (dos). And I need to calculate a date by subtracting the number of days from a given date. I know I could use an array of days in the months and go back by leaping when 1 is reached. (keeping the 29the of feb and january/year in mind). But is there no function in Borland C3.1 which will do this for me? I couldn't find one in the help? Regards Laery thelaery@hotpop.com (Laery) wrote in news:c615ddf1.0502240248.6b186e24@posting.google.com: > I'm currently adding a new module to an old borland C3.1 app...

Calculate date based on another date + number of minutes
Hi all, I need to write a code which gets a date (in format 'YYYYMMDDhh24MISS') and number of seconds (X), and returns the date (again in format 'YYYYMMDDHH24MISS') that is X seconds prior to the first date. Any ideas? Thanks in advance Golan said: > Hi all, > > I need to write a code which gets a date (in format 'YYYYMMDDhh24MISS') > and number of seconds (X), and returns the date (again in format > 'YYYYMMDDHH24MISS') that is X seconds prior to the first date. > Any ideas? I suggest you take a long hard look at the standard library fun...

calculate with date
Hi, I have a date-string given in format "dd.mm.yyyy". Now I would like to add 100 days. How can this be solved in python? ciao Detlef -- are you ready - attention - go Detlef Jockheck wrote: > I have a date-string given in format "dd.mm.yyyy". Now I would like to add 100 days. How can this > be solved in python? >>> from datetime import date, timedelta >>> d = date(2005, 2, 15) >>> d datetime.date(2005, 2, 15) >>> d + timedelta(days=100) datetime.date(2005, 5, 26) more here: http://docs.python.org/lib/module-dateti...

Date Calculations...
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 the SQL I have implemented. SELECT Field1, Field2, Field3 FROM Table1 WHERE (convert(char(10),Field1) like convert(char(8), GETDATE()-5)) For some reason this works, and ...

Calculating Dates
Access 97----Have searched the FAQ sites with no success. I need a dbase to keep a record of maintenance calls and plan the next call . The maintenance periods run in monthly cycles which vary according to the item. The maintenance periods are 3,6,9,12,18 and 24 months. The dbase has a field " Maint. Period Mths." which shows the Maint Period for that particular item. I would like to design the dbase with a field "Date" (being the last call made) and a field "Next Call" (a Date) and be able to do something like "Date" + " Maint Period Mths" =...

how to have a date calculation
May anyone can teach me how to calculate with date, my calculation is : Date field (2005/01) + numberic field (3) = 2005/04(YYYY/MM) Hi, Look at this VB function: DateAdd(interval, number, date) Use "m" for the [interval] parameter to indicate 'month'. HTH -Linda "Apple" <ttt_fff2003@yahoo.com.hk> wrote in message news:55044da2.0501240323.10a96366@posting.google.com... > May anyone can teach me how to calculate with date, my calculation is : > > Date field (2005/01) + numberic field (3) = 2005/04(YYYY/MM) ...