Recent

Author Topic: [SOLVED] How to enter genealogy dates  (Read 1026 times)

pmralbuquerque

  • New Member
  • *
  • Posts: 27
    • GitHub
[SOLVED] How to enter genealogy dates
« on: April 07, 2026, 06:26:26 pm »
Hello,

I've been reading posts about dates, date conversion and dates entering limits. I'm wondering, how does a genealogy program accepts 'old' dates?

For instance, if I want to enter my ancestor's birth date as 01/01/1491 to calculate my age difference to him ?

Or how do I convert a julian date, always prior to 15/10/1582 if I'm not mistaken, to an equivalent gregorian date ? Not a julian day, that one has its own functions, even thow named ...JulianDate...

I couldn't find a component that accepts those dates, but I find it hard to believe there isn't one. It must be my fault.

« Last Edit: April 08, 2026, 06:14:50 pm by pmralbuquerque »
Lazarus 4.4 / FPC 3.2.2
Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz   2.60 GHz RAM 16,0 GB
Windows 10 upgraded to 11

LeP

  • Full Member
  • ***
  • Posts: 224
Re: How to enter genealogy dates
« Reply #1 on: April 07, 2026, 07:45:23 pm »
In Delphi this (and the opposite function) will help: https://docwiki.embarcadero.com/Libraries/Florence/en/System.DateUtils.DateTimeToJulianDate

There should be also in FPC ...
Un Sistema per domarli, un IDE per trovarli, un codice per ghermirli e nel framework incatenarli.
An operating system to tame them, an IDE to find them, a code to catch them and in the framework chain them.

wp

  • Hero Member
  • *****
  • Posts: 13482
Re: How to enter genealogy dates
« Reply #2 on: April 07, 2026, 07:48:51 pm »
Found an extended dateutils unit with Gregorian/Julian calendar on https://www.delphipraxis.net/141399-dateutils-weitere-funktionen.html. Attaching the unit since download requires registration a this site. Did not test myself (clean up the used units, windows very probably is not needed)
« Last Edit: April 07, 2026, 07:50:37 pm by wp »

pmralbuquerque

  • New Member
  • *
  • Posts: 27
    • GitHub
Re: How to enter genealogy dates
« Reply #3 on: April 07, 2026, 07:53:24 pm »
@LeP and @wp thank you!

I'll make a note to remember searching Delphi as well.  :-[
Lazarus 4.4 / FPC 3.2.2
Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz   2.60 GHz RAM 16,0 GB
Windows 10 upgraded to 11

PeterEvans

  • New Member
  • *
  • Posts: 26
Re: How to enter genealogy dates
« Reply #4 on: April 08, 2026, 04:53:54 am »
There are some other aspects worth considering.

Are you going to support dates as defined in the defacto GEDCOM Standard? This is the standard for exchanging data. For example, the keyword "BEFORE" and "AFTER". So "BEFORE 8 April 2026".

Will you only allow dates to be input in the English language? What does "1/2/2026" mean?

How will you sort dates?

Will you allow for dates before the year 0?

pmralbuquerque

  • New Member
  • *
  • Posts: 27
    • GitHub
Re: How to enter genealogy dates
« Reply #5 on: April 08, 2026, 05:14:46 am »
Hello @PeterEvans, and thank you for your time.

This was a generic question to find a way to enter and convert dates, including those before 1752, I think this is the MinDate. So far, I couldn't find a Lazarus component that allows it. I'm going to try the other suggestions here today.

I'm well aware of the difficulty, with different countries changing calendars on different dates, etc., etc. It is a rather complicated algorithm; mine is not even close to being started.

It came to me because the genealogy programs I know and use don't do that conversion automatically. On one of those, one has to specify intentionally what calendar the date is being entered. The others don't even ask; they assume the user knows what they are doing.
Thankfully, they all write more or less usable Gedcom files, one claiming to be 100% compatible ;).
Lazarus 4.4 / FPC 3.2.2
Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz   2.60 GHz RAM 16,0 GB
Windows 10 upgraded to 11

pmralbuquerque

  • New Member
  • *
  • Posts: 27
    • GitHub
Re: How to enter genealogy dates
« Reply #6 on: April 08, 2026, 06:14:27 pm »
Like I thought, my fault.

It seems TDateEdit without a MinDate accepts any date, leaving it up to the user the input checking, whch is what I was looking for.

I'll mark this as solved. And keep that https://www.delphipraxis.net/141399-dateutils-weitere-funktionen.html unit, as it will probably become useful anytime.

Again, thank you all :)
Lazarus 4.4 / FPC 3.2.2
Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz   2.60 GHz RAM 16,0 GB
Windows 10 upgraded to 11

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12765
  • FPC developer.
Re: How to enter genealogy dates
« Reply #7 on: April 08, 2026, 07:15:35 pm »
In Delphi this (and the opposite function) will help: https://docwiki.embarcadero.com/Libraries/Florence/en/System.DateUtils.DateTimeToJulianDate

There should be also in FPC ...
Not that hard to find, https://www.freepascal.org/docs-html/rtl/dateutils/datetimetojuliandate.html

That said, in the last say decade (so also in the last half decade since the 3.2.2 release), there have been fixes to pre 1900 datetime support, which was initially not very good.

pmralbuquerque

  • New Member
  • *
  • Posts: 27
    • GitHub
Re: [SOLVED] How to enter genealogy dates
« Reply #8 on: April 08, 2026, 07:17:29 pm »
+1
Lazarus 4.4 / FPC 3.2.2
Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz   2.60 GHz RAM 16,0 GB
Windows 10 upgraded to 11

wp

  • Hero Member
  • *****
  • Posts: 13482
Re: [SOLVED] How to enter genealogy dates
« Reply #9 on: April 08, 2026, 08:14:27 pm »
The word "Julian" in relatation to date can have two meanings (https://www.quora.com/What-is-the-difference-between-a-Julian-calendar-and-a-Julian-date):

- "Julian date" - continuous count of days from the beginning of the Julian period; it is used primarily by astronomers, and in software for easily calculating elapsed days between two events
- "Julian calendar" - calendar system proposed by Julius Caesar (concept of normal years and leap years), later replaced by today's Gregorian calendar.

I don't know to which definition FPC's DateTimeToJulianDate applies.

PascalDragon

  • Hero Member
  • *****
  • Posts: 6381
  • Compiler Developer
Re: [SOLVED] How to enter genealogy dates
« Reply #10 on: April 10, 2026, 07:27:12 am »
The word "Julian" in relatation to date can have two meanings (https://www.quora.com/What-is-the-difference-between-a-Julian-calendar-and-a-Julian-date):

- "Julian date" - continuous count of days from the beginning of the Julian period; it is used primarily by astronomers, and in software for easily calculating elapsed days between two events
- "Julian calendar" - calendar system proposed by Julius Caesar (concept of normal years and leap years), later replaced by today's Gregorian calendar.

I don't know to which definition FPC's DateTimeToJulianDate applies.

For FPC it's the former.

 

TinyPortal © 2005-2018