To "Pay", simply press the
Thanks button on the appropriate post(s). There is no other currency on this site.
So, if a month has 30 days whatever the actual length, it becomes a little more straightforward. So, the decimal number is number of months (and fractional bits to be days) to add to the current or a given date.
Before looking to code this, can you confirm that my logic is acceptable:-
- Take the value to be added and multiply by 30 to get the number of days to add
- Round fractions of days up or down (you will need to confirm the rules for this)
- Add the days to the current date to give a the target date
Does that make sense?
I am confused, however, by your two statements:-
Quote:
I need to get exact minutes
Quote:
we can count that one month has 30 days, but if customer will buy for example for longer period of time he can loose several days.
Do you want exact minutes based on always having 30 days in a month? That's making less sense, although it could be logical in some way I suppose.
Could we perhaps:-
- Add the whole months
- Consider the fractions as being always of 30 day months
What tools would you prefer to work in? There could be
sh/
ksh/
bash,
awk,
perl, database query (you hint at the Oracle TO_DATE function) or many others. It's best for you if we work on something you are happy to support too.
Robin