* Quarter dates and Gedcom files

Importing from another genealogy program? This is the place to ask. Questions about Exporting should go in the Exporting sub-forum of the General Usage forum.
avatar
jclifford
Famous
Posts: 175
Joined: 03 Sep 2015 13:31
Family Historian: V7
Location: Kent
Contact:

Quarter dates and Gedcom files

Post by jclifford »

Because of the need to rely on the GRO index to identify individuals born in Britain since 1837, I have a lot of BMD dates in my FH databases in the form of quarter dates . FH displays these in the format I prefer ("Qn YYYY", similar to the GRO Index format of Qn/yyyy) but stores them in gedcoms in the official gedcom format " BET mmm yyyy AND mmm yyyy". Therefore this is the format used when creating a gedcom exported from FH and imported into an online database.

I use TNG which simply copies (and displays) the BET - AND format dates into its Born/Marriage/Death fields. I find this cumbersome to read and difficult for some non-genealogists to understand.

I have tried changing these dates back to Qn format in a gedcom exported from Family Historian
and found that TNG accepts them and displays them OK. It also sorts them accurately with other dates (in year order, I have not tried day or month order).

I would be interested to know how other members deal with quarter dates and whether they would support a request to Mike Tate to add this option to his Export plug-in for FH.
User avatar
Mark1834
Megastar
Posts: 2518
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Quarter dates and Gedcom files

Post by Mark1834 »

In the absence of any other data, I record birth and death dates as approx the first month of the quarter. Remember that the GRO date is registration not occurrence. Births in particular could be up to 6 weeks earlier, and I don't like defining precise limits when they will be wrong in many cases.
Mark Draper
User avatar
ADC65
Superstar
Posts: 472
Joined: 09 Jul 2007 10:27
Family Historian: V7

Re: Quarter dates and Gedcom files

Post by ADC65 »

If I only have a GRO Index reference, I only record the year and no further data in the date field. A lot of the times Q1 will mean the birth occurred in the previous year, so even this is not ideal, but it stops any confusion (especially in the non-genealogists you mention) around quarter dates meaning dates of BMDs rather than dates of registration of BMDs. I record the actual GRO reference in the source, e.g., Q2 1858 / Merthyr Tydfil / 11a / 298, which shows up nicely in TNG.

You could try recording the date as a date phrase (e.g., "Q2 1858"), I haven't tried that in TNG (yet) but it shows in the GEDCOM as the same phrase rather than a BETWEEN.
Adrian Cook
Researching Cook, Summers, Phipps and Bradford, mainly in Wales and the South West of England
User avatar
ADC65
Superstar
Posts: 472
Joined: 09 Jul 2007 10:27
Family Historian: V7

Re: Quarter dates and Gedcom files

Post by ADC65 »

Further to my last post, if you use a date phrase of "Q1 1924", this is what will appear in TNG:

Screenshot 2022-11-20 172643.jpg
Screenshot 2022-11-20 172643.jpg (17.12 KiB) Viewed 3027 times

If you use the optional "...interpreted as" checkbox in FH, you'll see this in TNG:

Screenshot 2022-11-20 172312.jpg
Screenshot 2022-11-20 172312.jpg (18.58 KiB) Viewed 3027 times
Adrian Cook
Researching Cook, Summers, Phipps and Bradford, mainly in Wales and the South West of England
User avatar
tatewise
Megastar
Posts: 28436
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Quarter dates and Gedcom files

Post by tatewise »

The snag with a (Q1 1924) date phrase is that it won't sort into date order, unless the interpreted (INT date) is added, which makes it less attractive. Unfortunately, TNG does not support Sort Dates (_SDATE) that would offer a workaround.

John also contacted me by Email and after a brief discussion says he has implemented a TNG Mod that displays those specific 'between' dates as Qn dates, which has the bonus of retaining the underlying GEDCOM format dates.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
ADC65
Superstar
Posts: 472
Joined: 09 Jul 2007 10:27
Family Historian: V7

Re: Quarter dates and Gedcom files

Post by ADC65 »

Thanks Mike. It would be helpful if he posted the Mod details here so others could use the solution in the future.
Adrian Cook
Researching Cook, Summers, Phipps and Bradford, mainly in Wales and the South West of England
avatar
jclifford
Famous
Posts: 175
Joined: 03 Sep 2015 13:31
Family Historian: V7
Location: Kent
Contact:

Re: Quarter dates and Gedcom files

Post by jclifford »

Mike and I seem to have misunderstood each other.

I have not written a Mod for TNG. What I did was:
choose a small gedcom exported from FH but not yet uploaded to TNG
open the gedcom in WordPad and change three quarter dates to Qn format
upload the altered gedcom to my TNG family site (with no problems).

I am attaching two screenshots from my TNG site; one showing search results for surname=Gray and one showing the same result table after sorting on column Born/christened.
You will see that the two Qn dates display and sort correctly.

I have tried several different methods of dealing with dates from the GRO index . Currently I use custom events in FH for Birth Reg and Death Reg and use ORA to fill both Born/Died and Birth/Death Reg fields from the index.
If I find more accurate/detailed dates, e.g. from baptism records or the 1939 register, I enter them into the Birth/Death fields in FH. This often allows me to enter the correct year for Q1 registration dates.
Attachments
Gray_sortedonBorn.pdf
(235.56 KiB) Downloaded 59 times
SearchResults_Gray.pdf
(233.4 KiB) Downloaded 55 times
User avatar
tatewise
Megastar
Posts: 28436
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Quarter dates and Gedcom files

Post by tatewise »

Sorry, I misunderstood which suggestion John had followed :oops:

I can see that TNG appears to recognise the year in the Qn dates and sort according to year.
But what if there are other dates in the same year as the Qn date with months that come beforehand and afterwards?
e.g. Feb 1856, Q2 1856, Aug 1856

I notice that <1897> sorts to the top of the list, so I wonder if TNG is sorting based on the rightmost characters and with month names replaced with two digits, i.e. Imagine the dates written in reverse and sorted, but displayed as normal.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
ADC65
Superstar
Posts: 472
Joined: 09 Jul 2007 10:27
Family Historian: V7

Re: Quarter dates and Gedcom files

Post by ADC65 »

TNG has a PHP function convert_date in which it takes the date from a GEDCOM and converts it into what is effectively a sort date. It stores this sort date along with the actual GEDCOM date in the SQL tables, and uses it to sort data as John has shown in his screenhots. For example, in the tng_events table, there is an eventdate column, and an eventdatetr column.

Code: Select all

9 SEP 1996 -> 1996-09-09
AUG 1965 -> 1965-08-00
CAL 1835 -> 1835-00-00
EST FEB 1887 -> 1887-02-00
And so on. Thus the sort order of the data will be based on eventdatetr, and the data displayed will be eventdate. If you're any good at PHP, it is possible to change the function so that that eventdate is changed back to the quarter format. It's best to do this via a TNG Mod otherwise future updates will overwrite your changes.

Note that other tables work similarly, e.g., tng_people has, among others, birthdate and birthdatetr, but they all call the convert_date function.

I know this is a bit technical, but hopefully it helps explain where the sort order comes from. Unfortunately I don't have the time to invest in writing a Mod for this, but I can provide guidance if needed.
Adrian Cook
Researching Cook, Summers, Phipps and Bradford, mainly in Wales and the South West of England
User avatar
ADC65
Superstar
Posts: 472
Joined: 09 Jul 2007 10:27
Family Historian: V7

Re: Quarter dates and Gedcom files

Post by ADC65 »

Thinking about it, there are two other approaches that might be easier:

1. After importing to TNG as normal, run an SQL query on the necessary tables that updates any BETWEEN dates. This would need to be done from CPANEL > phpMyAdmin > SQL.

2. Do a regular expression search/replace on the GEDCOM file before uploading, since what John has shown is that TNG will quite happily import and sort on quarter dates in the GEDCOM file.
Adrian Cook
Researching Cook, Summers, Phipps and Bradford, mainly in Wales and the South West of England
User avatar
tatewise
Megastar
Posts: 28436
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Quarter dates and Gedcom files

Post by tatewise »

Thanks Adrian, that helps, but not sure about your point 2.
The question is what eventdatetr values are used for Qn yyyy eventdate values?
My guess is yyyy-00-00 where yyyy is the Qn year, so won't sort correctly among dates with months in the same year.

Also, what eventdatetr values are used for <yyyy> eventdate values or (Qn yyyy) eventdate values?
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
ADC65
Superstar
Posts: 472
Joined: 09 Jul 2007 10:27
Family Historian: V7

Re: Quarter dates and Gedcom files

Post by ADC65 »

I will do a test this afternoon or early evening Mike and report back what I can.
Adrian Cook
Researching Cook, Summers, Phipps and Bradford, mainly in Wales and the South West of England
User avatar
ADC65
Superstar
Posts: 472
Joined: 09 Jul 2007 10:27
Family Historian: V7

Re: Quarter dates and Gedcom files

Post by ADC65 »

A quick test gives the following. Sorry it's messy, I wasn't sure how to do tables!

Code: Select all

eventdate		 > eventdatetr	> notes
(Q1 1991)		 > 0000-00-00	> Date Phrase in FH - TNG does not see a date so will sort to top of lists (assume <1991> is the same)
INT JAN 1991 (Q1 1991)	 > 0000-00-00	> Date Phrase with Interpret in FH - TNG same as above
BET JAN 1991 AND MAR 1991> 1991-01-00	> Entered as Q1 1991 in FH, but outputs to GEDCOM as BET/AND
Q1 1991			 > 1991-00-00	> Entered in FH as above, but GEDCOM edited to change to Q1 1991. TND understands, but year only
Last edited by tatewise on 21 Nov 2022 14:07, edited 2 times in total.
Reason: Inserted tabs to form table
Adrian Cook
Researching Cook, Summers, Phipps and Bradford, mainly in Wales and the South West of England
User avatar
ADC65
Superstar
Posts: 472
Joined: 09 Jul 2007 10:27
Family Historian: V7

Re: Quarter dates and Gedcom files

Post by ADC65 »

Mike, what I meant in (2) above is that a search could be done in the GEDCOM file, looking for (say) "BET JAN yyyy AND MAR" and changing it to "Q1 yyyy". TNG will import this with no problem. However, based on the tests above, this would only result in a "yyyy-00-00" sort field in TNG (as you correctly surmised) and so whether it is worth it is up to John or the user I guess. I suppose the accurate way would be to change the convert_date function, but then what sorting date should be used? The first day of the quarter? Or the last? Or somewhere in the middle?

This is why I don't use quarter dates :lol:
Adrian Cook
Researching Cook, Summers, Phipps and Bradford, mainly in Wales and the South West of England
User avatar
tatewise
Megastar
Posts: 28436
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Quarter dates and Gedcom files

Post by tatewise »

Sorting of Qn dates would appear to be less than ideal, as I suspected.
Clearly, TNG uses the first month in eventdatetr for the BET AND date (I think FH does the same).
So if there was an eventdatetr fix for Qn then it should use the first month too.
However, a TNG Date Mod to only adjust the eventdate display would be best.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
jclifford
Famous
Posts: 175
Joined: 03 Sep 2015 13:31
Family Historian: V7
Location: Kent
Contact:

Re: Quarter dates and Gedcom files

Post by jclifford »

Thank you Mike and Adrian for investigating this.

I still want to use the Qn format in TNG and am not bothered about possible problems with day/month sorting because I seldom have a need to sort in my websites.

There does not seem to be much support for adding a solution to the Export plugin so I will make my own arrangements.
John Clifford - researching Hulbert surname and Clifford (Stow/Mortlake branch)
User avatar
tatewise
Megastar
Posts: 28436
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Quarter dates and Gedcom files

Post by tatewise »

It is always good to explore the pros & cons of alternative techniques before deciding upon an acceptable solution.
Let me look at the Export Gedcom File plugin changes needed to provide the Qn option for BET AND dates.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
jclifford
Famous
Posts: 175
Joined: 03 Sep 2015 13:31
Family Historian: V7
Location: Kent
Contact:

Re: Quarter dates and Gedcom files

Post by jclifford »

Thank you, Mike.
John Clifford - researching Hulbert surname and Clifford (Stow/Mortlake branch)
User avatar
ADC65
Superstar
Posts: 472
Joined: 09 Jul 2007 10:27
Family Historian: V7

Re: Quarter dates and Gedcom files

Post by ADC65 »

tatewise wrote: 21 Nov 2022 14:12 However, a TNG Date Mod to only adjust the eventdate display would be best.
I had a look at the feasibility of this earlier this evening. I did manage to write some PHP code that almost did what was required, but I stumbled at the last hurdle. There are many places across the TNG code base that call the convert_date function. Each supplies an old_date parameter, and a new_date variable is returned. Within the function, I have coded so that the old_date is changed from a BET AND date to a Qn YYYY date, but it is not possible to return this as a variable. I would need to change the code at each point the function is called, which is just too much and would make the code base unstable.

My Plan B would be to write some SQL which can be run in CPANEL > phpMyAdmin > SQL after an import. It's quite simple to do, and would run through the affected tables changing the BET AND dates to Qn YYYY dates. However, before I started on this, I would like to know if this is something John would consider carrying out?

All in all, it's probably better to solve it at source in the GEDCOM via the Export Plugin, but I can help out if this turns out not to be feasible.
Adrian Cook
Researching Cook, Summers, Phipps and Bradford, mainly in Wales and the South West of England
avatar
jclifford
Famous
Posts: 175
Joined: 03 Sep 2015 13:31
Family Historian: V7
Location: Kent
Contact:

Re: Quarter dates and Gedcom files

Post by jclifford »

I don't think I would take the CPanel route,

I have written a small program which I use to change Witness events into a form which TNG will accept, so I could add conversion of quarter dates to that.
John Clifford - researching Hulbert surname and Clifford (Stow/Mortlake branch)
User avatar
tatewise
Megastar
Posts: 28436
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Quarter dates and Gedcom files

Post by tatewise »

Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
ADC65
Superstar
Posts: 472
Joined: 09 Jul 2007 10:27
Family Historian: V7

Re: Quarter dates and Gedcom files

Post by ADC65 »

jclifford wrote: 22 Nov 2022 10:05 I don't think I would take the CPanel route
OK, thanks for letting me know John. Let me know if you need any further help with TNG.
Adrian Cook
Researching Cook, Summers, Phipps and Bradford, mainly in Wales and the South West of England
User avatar
tatewise
Megastar
Posts: 28436
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Quarter dates and Gedcom files

Post by tatewise »

Try the attached Export Gedcom File plugin Version 5.0.1 Date 22 Nov 22 in ZIP format.
Download and use Extract All before installing into FH.

On its Extra Options tab, the Date Field %d DATE: has an option for BET/AND to Q1-4 yyyy that should convert the four BET/AND quarter dates to Q1, Q2, Q3 & Q4 respectively.
Last edited by tatewise on 18 Jan 2023 12:57, edited 1 time in total.
Reason: Attachment deleted as later version is in the Plugin Store.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
jclifford
Famous
Posts: 175
Joined: 03 Sep 2015 13:31
Family Historian: V7
Location: Kent
Contact:

Re: Quarter dates and Gedcom files

Post by jclifford »

The change of dates in your new plug-in seems to work perfectly - showing quarter dates as Qn yyyy but not messing up dates between one year and a later one.

I noticed you had also included an option to show Witness Role 2 as 2 ASSO and tried that, but it didn't do anything - probably not designed for use with TNG?
User avatar
tatewise
Megastar
Posts: 28436
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Quarter dates and Gedcom files

Post by tatewise »

I'm glad that the BET/AND Q1-4 change worked as expected.
I expect to publish the plugin soon as there are other outstanding fixes pending.

What did you expect 2 ASSO to achieve as a replacement for 2 _SHAR as it is not standard GEDCOM?
It is a hangover from when Heredis used 2 ASSO & 3 TITLE instead of 2 _SHAR & 3 ROLE that has become the de facto standard.
The standard ASSOciated Person code is 1 ASSO.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Post Reply