LifeLines Programmers Reference

Version 3.0.2

up | previous | next | Tom Wetmore | ttw@shore.net | LifeLines


Event and Date Functions

These functions extract information about the dates and places of events.

FunctionDescription
string date(event) Date returns the value of the first DATE line in an event, a node in a GEDCOM record tree. Date finds the first DATE line one level deeper than the event node.
string place(event) Place returns the value of the first PLAC line in an event.
string year(event) Year returns the first three or four digit number in the value of the first DATE line in an event; this number is assumed to be the year of the event.
string long(event) Long returns the verbatim values of the first DATE and PLAC lines in an event, catenated together and separated by a comma.
string short(event) Short abbreviates information from the first DATE and PLAC lines, catenates the shortened information together with a comma separator and returns it. An abbreviated date is its year; an abbreviated place is the last component in the value, further abbreviated if the component has an entry in the place abbreviation table.
event gettoday() Gettoday creates an event that has today's date in the DATE line.
void dayformat(int) Dayformat, monthformat, and,dateformat select output style options for formatting the day, month, and overall date structure; stddate returns dates in the selected style. The day format codes passed to dayformat are:

0 leave space before single digit days
1 use leading 0 before single digit days
2 no space or leading 0 before single digit days

void monthformat(int) Monthformat sets the month format style for later stddate calls. The month format codes passed to monthformat are:

0 number with space before single digit months
1 number with leading zero before single digit months
2 number with no space or zero before single digit months
3 upper case abbreviation (eg, JAN, FEB)
4 capitalized abbreviation (eg, Jan, Feb)
5 upper case full word (eg, JANUARY, FEBRUARY)
6 capitalized full word (eg, January, February)

void dateformat(int) Dateformat sets the overall output format style for later stddate calls. The date formats are encoded as:

0 da mo yr
1 mo da, yr
2 mo/da/yr
3 da/mo/yr
4 mo-da-yr
5 da-mo-yr
6 modayr
7 damoyr
8 yr mo da
9 yr/mo/da
10 yr-mo-da
11 yrmoda

string stddate(event) Stddate returns the date of the event, formatted according to the current month, day and date settings.

up | previous | next | Tom Wetmore | ttw@shore.net | LifeLines

1/1/00