Re: Looking for some logic help with dates and working outs.




"Kardon Coupé" <prefer.to@xxxxxxxxxxxxxxxxx> wrote in message
news:u%235ldMjNIHA.4688@xxxxxxxxxxxxxxxxxxxxxxx
Dear All,

I'm looking for a solution to this problem...

I have some variables that hold date and time information....

Public E_Day(1 To 5000)
Public E_Month(1 To 5000)
Public E_Year(1 To 5000)
Public E_Hour(1 To 5000)
Public E_Min(1 To 5000)

Basically I'm looking for a way to basically say, if the min is at say...
54mins, and I add 15 mins to it, it goes over 60 mins, so I was going to
subtract 60 and add 1 to the hour, obviously when the hour gets to 24 I
was
going to subtract 24, and 1 to the day.... Now here is the
problem.....when
the day reaches, 30 or 31, or 28 for February (or even 29 for a leap
year).....

So I'm thinking I have to look at the current month from the array, and
determine if I add one, or it is then in the next month, if that happens
to
fall on a February month, I'm going to have to look at the year too, and
somehow work out if it is a leap year, etc...

I'm starting to confuse myself with the logic behind this, and getting
lost
in my 'if' and 'then' statements.....

Can anybody point me in the right direction, there must be an easy way of
doing this, and I'm not thinking of it....


I would probably just use an Array of Dates and VB's Date functions to
manage the changes. Then all you would have to do is use DateAdd() to manage
the changes.

-ralph




.



Relevant Pages

  • Re: Use of arrays ...
    ... array formulas and array constants ... you want to create a dynamic multiple array, ONLY the last dimension can be ... > tariff A 70 mins ... > Trriff B 125 mins ...
    (microsoft.public.excel.misc)
  • Convert Array of Structures to Structure of arrays??
    ... What is the most efficient way to convert from a Array of Structures to Structure of arrays?? ... I have a text file and the data is not consistent, i.e. the first set of data to be extracted is X lines and second set is Y lines etc. ... One hour data takes me about 50 mins to process!!! ... Please advice ...
    (comp.soft-sys.matlab)
  • Re: Failed software Raid 5 Array?
    ... just assumed that I lost access to the files. ... I guess I just figured that if the array was corrupted by ... > Delete the volume that you created on the new disk. ... This is maintained by the NT software raid controller, ...
    (microsoft.public.win2000.general)
  • Re: Raid not shutting down when disks are lost?
    ... The array can't shutdown when there is a mounted filesystem. ... code to not mark that last disk as failed in the superblocks of the ... it would be nice if you could control how it handles lost ...
    (Linux-Kernel)
  • Re: To the residents of mid / west Wales
    ... it's setting off half a fucking hour earlier than the sat. nav. ... estimated arrival time. ... Once I got as far as Lampeter, I not only 'lost' the 10 mins. I'd ...
    (uk.rec.driving)

Loading