Aw: Re: Subtract n months from datetime [Why?]

2022-06-22 Thread Karsten Hilbert
> What makes sense depends on where you're looking from.
>
> It's 28 February, you need to keep it for 5 years, therefore you could
> reason that you can dispose of it on 28 February, 5 years hence.
>
> However, that happens to be a leap year.
>
> Should you still have it on 29 February?

Nope because that's *after* the 5 years (they end Feb 28).

If it originates on March 1st, however, you shouldn't dispose of it on Feb 29th 
just yet.

Karsten
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Subtract n months from datetime [Why?]

2022-06-22 Thread Paulo da Silva

Às 20:25 de 22/06/22, Barry Scott escreveu:




On 22 Jun 2022, at 17:59, Paulo da Silva  
wrote:

Às 05:29 de 21/06/22, Paulo da Silva escreveu:

As a general response to some comments ...

Suppose we need to delete records from a database older than ...
Today, it's usual to specify days. For example you have to keep some gov papers 
for 90 days. This seems to come from computers era. In our minds, however, we 
immediately think 90 days=3 months.
For example, one may want to delete some files older than 9 months. It's far 
more intuitive than 270 days.
When we talk about years it is still going. For example I need to keep my 
receipts for 5 years because IRS audits.
Accepting this, it's intuitive, for example, that 3 months before July, 31 is 
April, 30.
The same happens for the years. 5 years before February, 29 is February, 28.


The advantage of 30 days, 90 days etc is that a contract or law does not need 
to tell you
how to deal with the problems of calendar months.

As you say in peoples thoughts that 1 month or 3 months etc. But an accounts 
department
will know how to to the number of days till they have to pay up.

Yes. But my point is to justify why I want months. And it depends on the 
application.
Let's suppose a program for Joe User to clean something - files, for 
example. There are no rules except for the comfort of the user. He would 
prefer to be able to say 9 months back instead of 270 days. And by 9 
months, he expects to count down 9 months. Not 270 days.

That's what happens with the script I am writing.

Paulo
--
https://mail.python.org/mailman/listinfo/python-list


Re: Subtract n months from datetime [Why?]

2022-06-22 Thread MRAB

On 2022-06-22 20:25, Barry Scott wrote:




On 22 Jun 2022, at 17:59, Paulo da Silva  
wrote:

Às 05:29 de 21/06/22, Paulo da Silva escreveu:

As a general response to some comments ...

Suppose we need to delete records from a database older than ...
Today, it's usual to specify days. For example you have to keep some gov papers 
for 90 days. This seems to come from computers era. In our minds, however, we 
immediately think 90 days=3 months.
For example, one may want to delete some files older than 9 months. It's far 
more intuitive than 270 days.
When we talk about years it is still going. For example I need to keep my 
receipts for 5 years because IRS audits.
Accepting this, it's intuitive, for example, that 3 months before July, 31 is 
April, 30.
The same happens for the years. 5 years before February, 29 is February, 28.


The advantage of 30 days, 90 days etc is that a contract or law does not need 
to tell you
how to deal with the problems of calendar months.

As you say in peoples thoughts that 1 month or 3 months etc. But an accounts 
department
will know how to to the number of days till they have to pay up.

OT, but in the UK, when the Gregorian Calendar was adopted, there were 
complaints.


It's often believed that they were just being superstitious about 
"losing" 11 days, but the truth is that they were complaining that rent 
was paid by the month, but wages by the number of days worked.


That month was a lot shorter, with far fewer working days, yet they were 
still expected to pay the same rent!

--
https://mail.python.org/mailman/listinfo/python-list


Re: Subtract n months from datetime [Why?]

2022-06-22 Thread Barry Scott


> On 22 Jun 2022, at 17:59, Paulo da Silva 
>  wrote:
> 
> Às 05:29 de 21/06/22, Paulo da Silva escreveu:
> 
> As a general response to some comments ...
> 
> Suppose we need to delete records from a database older than ...
> Today, it's usual to specify days. For example you have to keep some gov 
> papers for 90 days. This seems to come from computers era. In our minds, 
> however, we immediately think 90 days=3 months.
> For example, one may want to delete some files older than 9 months. It's far 
> more intuitive than 270 days.
> When we talk about years it is still going. For example I need to keep my 
> receipts for 5 years because IRS audits.
> Accepting this, it's intuitive, for example, that 3 months before July, 31 is 
> April, 30.
> The same happens for the years. 5 years before February, 29 is February, 28.

The advantage of 30 days, 90 days etc is that a contract or law does not need 
to tell you
how to deal with the problems of calendar months.

As you say in peoples thoughts that 1 month or 3 months etc. But an accounts 
department
will know how to to the number of days till they have to pay up.

Barry


> 
> Again, this is my opinion and that's the way I like it :-)
> Regards
> Paulo
> -- 
> https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Subtract n months from datetime [Why?]

2022-06-22 Thread MRAB

On 2022-06-22 17:59, Paulo da Silva wrote:

Às 05:29 de 21/06/22, Paulo da Silva escreveu:

As a general response to some comments ...

Suppose we need to delete records from a database older than ...
Today, it's usual to specify days. For example you have to keep some gov
papers for 90 days. This seems to come from computers era. In our minds,
however, we immediately think 90 days=3 months.
For example, one may want to delete some files older than 9 months. It's
far more intuitive than 270 days.
When we talk about years it is still going. For example I need to keep
my receipts for 5 years because IRS audits.
Accepting this, it's intuitive, for example, that 3 months before July,
31 is April, 30.
The same happens for the years. 5 years before February, 29 is February, 28.

Again, this is my opinion and that's the way I like it :-)


What makes sense depends on where you're looking from.

It's 28 February, you need to keep it for 5 years, therefore you could 
reason that you can dispose of it on 28 February, 5 years hence.


However, that happens to be a leap year.

Should you still have it on 29 February?
--
https://mail.python.org/mailman/listinfo/python-list


Re: Subtract n months from datetime [Why?]

2022-06-22 Thread Paulo da Silva

Às 05:29 de 21/06/22, Paulo da Silva escreveu:

As a general response to some comments ...

Suppose we need to delete records from a database older than ...
Today, it's usual to specify days. For example you have to keep some gov 
papers for 90 days. This seems to come from computers era. In our minds, 
however, we immediately think 90 days=3 months.
For example, one may want to delete some files older than 9 months. It's 
far more intuitive than 270 days.
When we talk about years it is still going. For example I need to keep 
my receipts for 5 years because IRS audits.
Accepting this, it's intuitive, for example, that 3 months before July, 
31 is April, 30.

The same happens for the years. 5 years before February, 29 is February, 28.

Again, this is my opinion and that's the way I like it :-)
Regards
Paulo
--
https://mail.python.org/mailman/listinfo/python-list