


How to convert Julian calendar dates to Julian day counts in PHP calendar
In php, there is a method to convert the date of the Julian calendar into a Julian day count. Today we will introduce this algorithm. Friends in need can refer to it.
We must have learned the PHP calendar extension before, but do you know that there is actually a very interesting function in the calendar extension, which is the juliantojd() function. This function can convert a date in the Julian calendar into a Julian day count. Isn't it amazing?
We will definitely have a question before learning this function, that is, what is the Julian calendar? I believe many people don’t know that the Julian calendar was actually developed by Julius Caesar (also translated as Gaius Julius Caesar, Gaius Julius Caesar), the dictator of the Roman Republic. A calendar that replaced the old Roman calendar and was implemented on January 1, 45 BC, after Julius Caesar, Julius Caesar, etc.) adopted the calculations of Sosichenius, a mathematician and astronomer in Alexandria, Egypt.
Use this
Unix timestamp conversion toolto get the results directly, and you no longer have to worry about wrong results. Now that we know the Julian calendar, let us take a look at the juliantojd() function.
Syntaxjuliantojd(month,day,year);
day, specified as day , the date range is from 1 to 31
year, specified as year, and the year range is from -4713 to 9999 (reasonable years in the Julian calendar are 4713 B.C. to 9999 A.D.)
Return value: Specifies the number of julian days corresponding to the date in the julian calendar.
Example - Convert a Julian calendar date to a Julian calendar date, and then convert back to a Julian calendar date<?php
$jd=juliantojd(7,07,1972);
echo $jd . "<br>";
echo jdtojulian($jd);//jdtojulian函数将儒略日计数的日期转换为儒略历法
?>
2441519
7/7/1972
In the Julian calendar, a year is divided into 12 months, with big and small months alternating; there is a leap every four years, and there are 365 days in an ordinary year. , 366 days in a leap year means adding a leap day at the end of February of that year, and the average annual length is 365.25 days. As the accumulated errors in actual use became larger and larger over time, in 1582 Pope Gregory XIII (also translated as Gregory XIII) promulgated and implemented a calendar based on the Julian calendar that was improved. The Gregorian calendar is the Gregorian calendar.
Recommendation:《2021 PHP interview questions summary (collection)》《php video tutorial》
The above is the detailed content of How to convert Julian calendar dates to Julian day counts in PHP calendar. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



In this chapter, we will understand the Environment Variables, General Configuration, Database Configuration and Email Configuration in CakePHP.

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

Working with database in CakePHP is very easy. We will understand the CRUD (Create, Read, Update, Delete) operations in this chapter.

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

To work on file upload we are going to use the form helper. Here, is an example for file upload.

In this chapter, we are going to learn the following topics related to routing ?

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

Validator can be created by adding the following two lines in the controller.
