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 beca

Re: Subtract n months from datetime

2022-06-22 Thread Paulo da Silva
Às 19:47 de 22/06/22, Marco Sulla escreveu: The package arrow has a simple shift method for months, weeks etc https://arrow.readthedocs.io/en/latest/#replace-shift At first look it seems pretty good! I didn't know it. Thank you Marco. Paulo -- https://mail.python.org/mailman/listinfo/python-l

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 exa

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

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 go

Re: Subtract n months from datetime

2022-06-22 Thread Marco Sulla
The package arrow has a simple shift method for months, weeks etc https://arrow.readthedocs.io/en/latest/#replace-shift -- https://mail.python.org/mailman/listinfo/python-list

Re: Logging into single file from multiple modules in python when TimedRotatingFileHandler is used

2022-06-22 Thread Dieter Maurer
Chethan Kumar S wrote at 2022-6-21 02:04 -0700: > ... >I have a main process which makes use of different other modules. And these >modules also use other modules. I need to log all the logs into single log >file. Due to use of TimedRotatingFileHandler, my log behaves differently after >midnight

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

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 m

Re: Logging into single file from multiple modules in python when TimedRotatingFileHandler is used

2022-06-22 Thread Lars Liedtke
The process that is writing the file must be told that rotation has happened for it to work. Other wise all the logs keep being write to the original file via the FD that the process has. logrotate's config include how to tell the process the log file needs reopening. Thanks for clearing.

Re: Logging into single file from multiple modules in python when TimedRotatingFileHandler is used

2022-06-22 Thread Barry Scott
> On 22 Jun 2022, at 11:06, Lars Liedtke wrote: > > Could be unrelated and only a part of a solution, but if you are on a unixoid > system, you could use logrotate, instead of TimedRotatingFileHandler. > logfrotate ensures that the logging service does not realize, its logs have > been rota

Re: Logging into single file from multiple modules in python when TimedRotatingFileHandler is used

2022-06-22 Thread Lars Liedtke
-- Lars Liedtke Software Entwickler Phone: Fax:+49 721 98993- E-mail: l...@solute.de solute GmbH Zeppelinstraße 15 76185 Karlsruhe Germany Marken der solute GmbH | brands of solute GmbH billiger.de | Shopping.de Geschäftsführe