Creates a new date object with its date set to $unix_timestamp
(seconds since 1970-01-01).
$date = new FlorealDate(-5369241600);
echo $date
will output:
18 brumaire, an VIII
Creates a new date object a set date.
$date = new FlorealDate(8, 2, 18);
echo $date
will output:
18 brumaire, an VIII
Returns the full date in long form as "[day number] [month name], an [year in roman numerals]"
$date = new FlorealDate(-5369241600);
echo $date->to_full_date_string();
will output:
18 brumaire, an VIII
This is a "magic method" that PHP uses to automatically convert Objects to strings. The output is identical to FlorealDate::toFullDateString()
.
$date = new FlorealDate(-5369241600);
echo $date
will output:
18 brumaire, an VIII
Returns the full date in short form as "[day number]-[month number]-[year in roman numerals]"
$date = new FlorealDate(-5369241600);
echo $date->to_short_date_string();
will output:
18-02-VIII
Sets the full Republican date
$date = new FlorealDate();
$date->set_republican_date(8, 2, 18);
echo $date
will output:
18 brumaire, an VIII
Displays year of the Republic as a decimal number
Displays year of the Republic as roman numerals
$date = new FlorealDate(8, 2, 18);
echo $date->republican_year();
echo $date->republican_year_roman();
will output:
8
VIII
Returns true if year is sextile, using actual sextile years for years I to XVI, and Romme system for subsequent years.
echo (FlorealDate(8, 11, 9))->is_year_sextile();
echo (FlorealDate(11, 11, 30))->is_year_sextile();
will output:
false
true
Returns the first day of the Republican year as a DateTime object.
var Floreal = require('floreal').Date;
echo (new FlorealDate(8, 11, 9))->first_day_of_year()->format("c"));
echo (new FlorealDate(11, 8, 18))->first_day_of_year()->format("c"));
will output:
Mon Sep 23 1799
Thu Sep 23 1802
Returns the day number within the year (from 1 to 365, or 366 for sextile years).
echo (new FlorealDate(8, 11, 9))->republican_day_of_year();
will output:
309
Returns the month number within the year. Complementary days are technically not part of any month, but for practical purposes are considered part of the 13th month.
echo (new FlorealDate(8, 11, 9))->republican_month();
will output:
11
Whether the day is a complementary day—the five or six days at the end of the year which are not part of any month.
echo (new FlorealDate(8, 11, 9))->is_complementary_day();
echo (new FlorealDate(8, 13, 1))->is_complementary_day();
will output:
false
true
Returns the (French) name of the month, in all lower case, or 'sans-culottide' for complementary days.
echo (new FlorealDate(strtotime("1799-11-09")))->republican_month_name();
echo (new FlorealDate(strtotime("1800-09-20")))->republican_month_name();
will output:
"brumaire"
"sans-culottide"
Returns the day number within its month, from 1 to 30 (1 to 6 for complementary days).
echo (new FlorealDate(strtotime("1799-11-09")))->republican_day();
echo (new FlorealDate(strtotime("1800-09-20")))->republican_day();
will output:
18
3
Returns the day number within its decade, from 1 to 10 (1 to 6 for complementary days).
echo (new FlorealDate(strtotime("1799-11-09")))->republican_day_of_decade();
echo (new FlorealDate(strtotime("1800-09-20")))->republican_day_of_decade();
will output:
8
3
Returns the name of the day (primidi, duodi... equivalent to monday, tuesday...). Complementary days have a different naming scheme and are named "jour de la vertu", "jour du génie", etc.
echo (new FlorealDate(strtotime("1799-11-09")))->republican_day_name();
echo (new FlorealDate(strtotime("1800-09-20")))->republican_day_name();
will output:
octidi
jour du travail
Returns the French name of the object associated with the day (like saints on Christian calendars).
echo (new FlorealDate(strtotime("1799-11-09")))->republican_day_title();
will output:
dentelaire