Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #81245

Re: Using Python for date calculations

From Denis Beauregard <denis.b-at-francogene.com@fr.invalid>
Newsgroups soc.genealogy.computing, comp.lang.python
Subject Re: Using Python for date calculations
Date 2014-11-21 15:07 -0500
Organization Les Productions FrancoGene
Message-ID <1g6v6apugp266oiots4hu3m563cml6943b@4ax.com> (permalink)
References <k7tt6aheccqv06enkume0vs0v6kvvhns45@4ax.com> <5l4v6a1kp9chnv9lmie3sb8b1ko69kjem3@4ax.com>

Cross-posted to 2 groups.

Show all headers | View raw


On Fri, 21 Nov 2014 14:35:14 -0500, Dennis Lee Bieber
<bieber.genealogy@earthlink.net> wrote in soc.genealogy.computing:

>On Fri, 21 Nov 2014 10:35:19 +0200, Steve Hayes <hayesstw@telkomsa.net>
>declaimed the following:
>
>
>>This Python script does it for me. 
>>
>>year = input("Year: ")
>>age = input("Age: ")
>>born = year-age
>>print 'Year of birth:', born
>>
>>It's so simple, so elementary, that it's not really worth writing about,
>>except for the fact that it illustrates the KISS principle. 
>>
>	And it is wrong since it doesn't take into account the month.
>
>	2014 - 55 => 1959
>
>	But I was born in April of 1958, so any calculation done for
>January/February/March (and the first week of April) is going to produce
>the incorrect year (I /was/ 55 in January of 2014...)

I made a lot of automated computations from census. In Quebec, we
have censuses for 1666, 1667 and 1681, and also ages in some marriage
records, marriage contracts, burials, and some more records. In
Acadia, there are other old censuses.

Sometimes, the result is accurate, i.e. there is a known baptism
and the age is matching, but in many cases either the age is not
matching or the year of birth is changing a lot depending on the
record. So, if the computation is made to give a hint about the
birth year, then the month is irrelevant. The result will be 
"about that year" and not "that year". In the database I sell, I
write exactly that, i.e. (actual example, from Acadian censuses) :

Germain, born about 1650 (census 1671), 1652 (census 1686) (census
1693), 1650 (census 1698) or 1649 (census 1699)

Marguerite, born about 1658 (census 1671), 1660 (census 1693), 1658
(census 1698) or 1661 (census 1699)

-- 
Denis Beauregard - généalogiste émérite (FQSG)
Les Français d'Amérique du Nord - www.francogene.com/genealogie--quebec/
French in North America before 1722 - www.francogene.com/quebec--genealogy/
Sur cédérom à 1785 - On CD-ROM to 1785

Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Using Python for date calculations Steve Hayes <hayesstw@telkomsa.net> - 2014-11-21 10:35 +0200
  Re: Using Python for date calculations Chris Angelico <rosuav@gmail.com> - 2014-11-21 19:40 +1100
    Re: Using Python for date calculations Steve Hayes <hayesstw@telkomsa.net> - 2014-11-21 12:15 +0200
      Re: Using Python for date calculations Chris Angelico <rosuav@gmail.com> - 2014-11-21 21:18 +1100
      Re: Using Python for date calculations alister <alister.nospam.ware@ntlworld.com> - 2014-11-21 10:33 +0000
        Re: Using Python for date calculations Chris Angelico <rosuav@gmail.com> - 2014-11-21 21:47 +1100
        Re: Using Python for date calculations random832@fastmail.us - 2014-11-21 08:54 -0500
          Re: Using Python for date calculations alister <alister.nospam.ware@ntlworld.com> - 2014-11-21 14:54 +0000
        Re: Using Python for date calculations random832@fastmail.us - 2014-11-21 08:58 -0500
          Re: Using Python for date calculations Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-11-22 01:55 +1100
            Re: Using Python for date calculations Ned Batchelder <ned@nedbatchelder.com> - 2014-11-21 10:25 -0500
        Re: Using Python for date calculations Chris Angelico <rosuav@gmail.com> - 2014-11-22 01:08 +1100
      Re: Using Python for date calculations Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-11-21 14:50 -0500
        Re: Using Python for date calculations Steve Hayes <hayesstw@telkomsa.net> - 2014-11-22 07:07 +0200
          Re: Using Python for date calculations Chris Angelico <rosuav@gmail.com> - 2014-11-22 16:13 +1100
  Re: Using Python for date calculations Gary Herron <gary.herron@islandtraining.com> - 2014-11-21 00:50 -0800
  Re: Using Python for date calculations Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-11-21 10:20 +0000
    Re: Using Python for date calculations alister <alister.nospam.ware@ntlworld.com> - 2014-11-21 10:38 +0000
    Re: Using Python for date calculations Steve Hayes <hayesstw@telkomsa.net> - 2014-11-21 17:50 +0200
      Re: Using Python for date calculations Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-11-21 16:01 +0000
  Re: Using Python for date calculations Chris Angelico <rosuav@gmail.com> - 2014-11-21 21:27 +1100
  Re: Using Python for date calculations duncan smith <buzzard@invalid.invalid> - 2014-11-21 17:03 +0000
    Re: Using Python for date calculations Steve Hayes <hayesstw@telkomsa.net> - 2014-11-21 21:48 +0200
      Re: Using Python for date calculations Dennis Lee Bieber <bieber.genealogy@earthlink.net> - 2014-11-21 15:32 -0500
  Re: Using Python for date calculations Dennis Lee Bieber <bieber.genealogy@earthlink.net> - 2014-11-21 14:35 -0500
    Re: Using Python for date calculations Paul Blair <p.blair@internode.on.net> - 2014-11-22 06:51 +1100
      Re: Using Python for date calculations Steve Hayes <hayesstw@telkomsa.net> - 2014-11-22 07:31 +0200
    Re: Using Python for date calculations Denis Beauregard <denis.b-at-francogene.com@fr.invalid> - 2014-11-21 15:07 -0500
      Re: Using Python for date calculations Steve Hayes <hayesstw@telkomsa.net> - 2014-11-22 07:34 +0200

csiph-web