Parsing Year month and day from date?
GenoPro Home  |  Get Started With My Genealogy Tree  |  Buy  |  Login  |  Privacy  |  Search  |  Site Map
 
GenoPro Support Forum
Home        Members    Who's On
Welcome Guest ( Login | Register )
        



Parsing Year month and day from date? Expand / Collapse
Author
Message
Post #20393 Posted 1/13/2008 12:16:54 AM


Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Customers
Last Login: 2/12/2008 3:14:16 AM
GenoPro Version: 2.0.1.3
Posts: 14, Visits: 50
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)
Post #20394 Posted 1/13/2008 4:17:37 AM


Grand Master

Grand MasterGrand MasterGrand MasterGrand MasterGrand MasterGrand MasterGrand MasterGrand Master This user is a contributor to FamilyTrees.GenoPro.com This user is an important contributor to the GenoPro community 

Group: Customers
Last Login: Today @ 7:08:51 AM
GenoPro Version: 2.0.1.6
Posts: 1,145, Visits: 5,354
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"
Post #20401 Posted 1/13/2008 9:58:05 AM


Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Customers
Last Login: 2/12/2008 3:14:16 AM
GenoPro Version: 2.0.1.3
Posts: 14, Visits: 50
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)
Post #20402 Posted 1/13/2008 11:34:48 AM


Grand Master

Grand MasterGrand MasterGrand MasterGrand MasterGrand MasterGrand MasterGrand MasterGrand Master This user is a contributor to FamilyTrees.GenoPro.com This user is an important contributor to the GenoPro community 

Group: Customers
Last Login: Today @ 7:08:51 AM
GenoPro Version: 2.0.1.6
Posts: 1,145, Visits: 5,354
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"
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: GenoProSupport, JcMorin, Ron

Permissions Expand / Collapse

All times are GMT -5:00, Time now is 9:32 AM

Copyright 1998-2008 GenoPro. All rights reserved. GenoPro and the GenoPro logo are trademarks.