new LegacyDate - jcobban/Genealogy GitHub Wiki

new LegacyDate($value)

Up: class LegacyDate

The constructor for an instance of LegacyDate has one parameter:

parameter description
$value is a string value. If the value is not a single character special type flag, or it is less than the 18 characters required to represent an internal date or the value contains a space or a slash (/) then the entire value is interpreted as an external human readable date, for which a broad range of formats are supported. Otherwise it is interpreted as an internal date value. If you are uncertain prepend a space so it will be interpreted as an external date.

Examples:

$date       = new LegacyDate('6 June 1944');   // external contains a space
$date       = new LegacyDate('1951');          // external less than 18 characters
$date       = new LegacyDate('1951/02/01');    // external less than 18 characters
$date       = new LegacyDate('001505191220061918'); // internal "from 15 May 1912 to 20 Jun 1918"
$date       = new LegacyDate(':00000186600000000\  estimated   as   1866'); // internal
$date       = new LegacyDate('March 15th 44 BC');
$date       = new LegacyDate('Ides March DCCXI AUC');
$date       = new LegacyDate('February 22nd, 1732 OS');
$date       = new LegacyDate('18 Brumaire VII'); // French Republican Calendar
$date	    = new LegacyDate($record->get($dateFldName)); // create from internal representation

The first token in the string may be one of the following which determines general characteristics of the date: 'In', 'On', 'Abt', 'About', 'Cir', 'Circa', 'Bef', 'Before', 'Aft', 'After', 'Between', 'Bet', 'WFT', 'Est', 'Cal', 'Calculated', 'From', 'To', or '<'.

Roman numerals may be used anywhere that Hindu-Arabic numerals may be used. That is for the year, a numeric month, or a day of the month. Roman numerals may be in either upper or lower case.

The following reserved words are accepted as month names within the string:

reserved word number epoch
'Jan' 1 AD
'Jany' 1 AD
'January' 1 AD
'Feb' 2 AD
'Feby' 2 AD
'February' 2 AD
'Mar' 3 AD
'March' 3 AD
'Apr' 4 AD
'Aprl' 4 AD
'April' 4 AD
'May' 5 AD
'Jun' 6 AD
'June' 6 AD
'Jul' 7 AD
'July' 7 AD
'Aug' 8 AD
'Augt' 8 AD
'August' 8 AD
'Sep' 9 AD
'Sept' 9 AD
'September' 9 AD
'Oct' 10 AD
'Octr' 10 AD
'October' 10 AD
'Nov' 11 AD
'Novr' 11 AD
'November' 11 AD
'Dec' 12 AD
'Decr' 12 AD
'December' 12 AD
'Vendémiaire' 1 French
'Vendemiaire' 1 French
'Brumaire' 2 French
'Frimaire' 3 French
'Nivôse' 4 French
'Nivose' 4 French
'Pluviôse' 5 French
'Pluviose' 5 French
'Ventôse' 6 French
'Ventose' 6 French
'Germinal' 7 French
'Floréal' 8 French
'Floreal' 8 French
'Prairial' 9 French
'Messidor' 10 French
'Thermidor' 11 French
'Fervidor' 11 French
'Fructidor' 12 French

Next: $date->getDate()