GenoPro Home
GenoPro Home  |  Get Started With My Genealogy Tree  |  Buy  |  Login  |  Privacy  |  Search  |  Site Map
 

GenoPro Support Forum




Parsing Year month and day from date?

Click to view RSS...
Author How do you reliably retrieve the year month and day from a date in the report writer?
Posted Saturday, January 12, 2008 - Post #20393
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Customers
Gamma
GenoPro version: 3.1.0.1

Last Login: Thursday, February 11, 2021
Posts: 14, Visits: 52
Take the Birth.Date property of the as an example.

These properties do not necessarily hold a "date" since they can hold either a complete date (i.e. a month day and year) or a partial date (i.e. a month and a year or a month and a day).

Given this fact, how would I go about "parsing" the Birth.Date property of an individual to try to retrieve the separate values of the Month, day and year?

So far, my testing seems to indicate first that the property returns data in the DD/MM/YYYY format when it's a full date. Is this always the case or is the format based on the user's localization settings?

It further appears that there are for possibilities as to what might be in a "date" field of this type:
1) DD/MM/YYYY
2) DD/MM
3) DD/YYYY
4) YYYY

Is this accurate?

If this is true, then, can I assume that years and only years will always be 4 digits long?
If all this is true, then would it be safe to say that:
1) if there's only one "part" of a date present then it must be a year.
2) If there are two "parts" of the a date present and the second "part" is a two digit number then it will ways represent a month but if it is a four digit number then it will always be a year

If there's an easier way to figure all this out I'd love to hear it. If there isn't an easier way, then is there anything wrong in my logic?




Tom Malia
"a society that draws a broad line between it's military and it's intellectuals has it's wars fought by idiots and it's thinking done by cowards" (paraphrased from a source that I no longer remember)
Posted Saturday, January 12, 2008 - Post #20394
Legendary Master

Legendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary Master

Administrators
Customers
Important Contributors
FamilyTrees.GenoPro.com
GenoPro version: 3.1.0.1

Last Login: 2 days ago @ 9:23 PM
Posts: 3,464, Visits: 26,854
The GenoPro Date class has all the properties you should need.


'lego audio video erro ergo disco' or "I read, I listen, I watch, I make mistakes, therefore I learn"
Posted Sunday, January 13, 2008 - Post #20401
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Customers
Gamma
GenoPro version: 3.1.0.1

Last Login: Thursday, February 11, 2021
Posts: 14, Visits: 52
Perfect! Thanks!

Tom Malia
"a society that draws a broad line between it's military and it's intellectuals has it's wars fought by idiots and it's thinking done by cowards" (paraphrased from a source that I no longer remember)
Posted Sunday, January 13, 2008 - Post #20402
Legendary Master

Legendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary Master

Administrators
Customers
Important Contributors
FamilyTrees.GenoPro.com
GenoPro version: 3.1.0.1

Last Login: 2 days ago @ 9:23 PM
Posts: 3,464, Visits: 26,854
There is also an Approximation property, that I don't think is documented in the SDK (Jean-Claude - please note) e.g. i.Birth.Date.Approximation to get any approximation character from the date ie. <, ~ or >.


'lego audio video erro ergo disco' or "I read, I listen, I watch, I make mistakes, therefore I learn"


Edited: Sunday, January 13, 2008 by Ron


Similar Topics

Click to view RSS...
Expand / Collapse

Reading This Topic

Expand / Collapse