Re: # of Months between two dates

2018-04-06 Thread Jason Friedman
> > >> > It's probably better to write the function yourself according to what > >> > makes sense in your use-case, and document its behaviour clearly. > >> > >> > > I suggest using the dateutil module ( > > https://pypi.python.org/pypi/python-dateutil) before writing your own. > > I'm not seeing a

Re: # of Months between two dates

2018-04-06 Thread Steven D'Aprano
On Fri, 06 Apr 2018 10:56:21 +0100, bartc wrote: > Agree with the messiness of dealing with months, but I think it's one of > those quirks that make life more interesting, like imperial measure. I > don't think we really want metric applied to time and to dates. (10-day > weeks? I don't think so.)

Re: # of Months between two dates

2018-04-06 Thread bartc
On 06/04/2018 07:16, Steven D'Aprano wrote: - instead of counting days, with all the difficulty that causes, we could just count how many times the month changes; - in which case, Jan 31 to Feb 1 is one month. If you book airport parking in the UK, the charge period runs from the midni

Re: # of Months between two dates

2018-04-05 Thread Steven D'Aprano
On Thu, 05 Apr 2018 22:03:07 -0600, Jason Friedman wrote: >> > > I've written a function to return the months between date1 and >> > > date2 >> but >> > > I'd like to know if anyone is aware of anything in the standard >> > > library to do the same? For bonus points, does anyone know if >> > > p

Re: # of Months between two dates

2018-04-05 Thread Jason Friedman
> > > > I've written a function to return the months between date1 and date2 > but > > > I'd like to know if anyone is aware of anything in the standard library > > > to do the same? For bonus points, does anyone know if postgres can do > > > the same (we use a lot of date/time funcitons in postgr

Re: # of Months between two dates

2018-04-05 Thread ankit . singh
On Sunday, August 8, 2010 at 11:46:51 PM UTC+5:30, MRAB wrote: > Greg Lindstrom wrote: > > I work for a company that processes claims for the health care industry > > (Novasys Health, recently purchased by Centene Corp). My current > > assignment has me writing a routine to compute insurance pre

Re: # of Months between two dates

2010-08-08 Thread Joel Goldstick
Greg Lindstrom wrote: I work for a company that processes claims for the health care industry (Novasys Health, recently purchased by Centene Corp). My current assignment has me writing a routine to compute insurance premiums. One of the requirements is to determine how many months a policy has

Re: # of Months between two dates

2010-08-08 Thread MRAB
Greg Lindstrom wrote: I work for a company that processes claims for the health care industry (Novasys Health, recently purchased by Centene Corp). My current assignment has me writing a routine to compute insurance premiums. One of the requirements is to determine how many months a policy ha

# of Months between two dates

2010-08-08 Thread Greg Lindstrom
I work for a company that processes claims for the health care industry (Novasys Health, recently purchased by Centene Corp). My current assignment has me writing a routine to compute insurance premiums. One of the requirements is to determine how many months a policy has been in effect. The date