Introduction
In this tutorial you will learn how to use PHP calendar functions. The PHP calendar functions is used to implement various types of calendar formats. Here I will explain about some Calendar functions and I am also describing some PHP calendar functions in PART 2.
PHP Calendar FrenchToJD function
It converts a date from French Republican Calendar to a Julian day count. This routine only converts dates in years 1 through 14.
For example
Gregorian date 22-9-1792 through 22-9-1806.
Syntax
| frenchtojd (month, day, year) |
Parameters in frenchtojd function
It has three parameters and every parameter is required in this function.
| Parameter | Description |
| month | It specifies month number. |
| day | It specifies day number. |
| year | It specifies year as a number from 1 to14.. |
Example of frenchtojd function:
|
<?php $days=frenchtojd(1,20,12); echo $days; |
Output
PHP Calendar GregorianToJD function
It converts a date from Gregorian calendar to Julian calendar. The valid range for Gregorian calendar is 4714 B.C to 9999 A.D.
Syntax
| gregoriantojd (month, day, year) |
Parameters in GregorianToJD function
It has three parameters and every parameter is required in this function.
| Parameter | Description |
| month | It specifies month number. |
| day | It specifies day number. |
| year | It specifies year. |
Example of GregorianToJD function:
|
<?php $julianday=gregoriantojd(6,12,2005); echo $julianday; ?> |


Sharad GuptaPosted Dec 27, 2012, 6:59 AM
NItin-you can see my http://www.c-sharpcorner.com/UploadFile/c63ec5/canendar-function-in-php-part-2/ article for date format.
Nitin BhardwajPosted Dec 26, 2012, 7:39 AM
Can we write date in own format? nice explanation.