Giter Site home page Giter Site logo

floreal-php's Introduction

floreal

Usage

FlorealDate::__construct($unix_timestamp)

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

FlorealDate::__construct($republican_year, $republican_month, $republican_day)

Creates a new date object a set date.

$date = new FlorealDate(8, 2, 18);
echo $date

will output:

18 brumaire, an VIII

FlorealDate::to_full_date_string()

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

FlorealDate::__toString()

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

FlorealDate::to_short_date_string()

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

FlorealDate::set_republican_date($republican_year, $republican_month, $republican_day)

Sets the full Republican date

$date = new FlorealDate();
$date->set_republican_date(8, 2, 18);
echo $date

will output:

18 brumaire, an VIII

FlorealDate::republican_year()

FlorealDate::republican_year_decimal()

Displays year of the Republic as a decimal number

FlorealDate::republican_year_roman()

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

FlorealDate::is_year_sextile()

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

FlorealDate::first_day_of_year()

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

FlorealDate::republican_day_of_year()

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

FlorealDate::republican_month()

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

FlorealDate::is_complementary_day()

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

FlorealDate::republican_month_name()

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"

FlorealDate::republican_day()

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

FlorealDate::day_of_decade()

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

FlorealDate::republican_day_name()

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

FlorealDate::republican_day_title()

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

floreal-php's People

Contributors

seeschloss avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.