Webmaster

References : PHP 4.0


PHP calendars

To work efficiently with date type values in PHP, you must first convert them into a Julian day count. This is the only way to obtain a whole number, which is a basic requirement for carrying out PHP calendar conversions. This value can then be used with other functions to produce different dates in whichever format you wish among the numerous ones PHP has to offer.

frenchtojd(month, day, year) | gregoriantojd(month, day, year) | jddayofweek(julian_day_count, calendar_mode) | jdmonthname(julian_day_count, calendar_mode) | jdtofrench(julian_day_count) | jdtogregorian(julian_day_count) | jdtojewish(julian_day_count) | jdtojulian(julian_day_count) | jewishtojd(month, day, year) | juliantojd(month, day, year)

frenchtojd(month, day, year)
Enables you to obtain a Julian day count from a French Republican calendar date passed as the argument to the function.
 
Example<?
  frenchtojd(1,1,1);
?>
 
 Top
gregoriantojd(month, day, year)
Enables you to obtain a Julian day count calculated from a Gregorian date passed as the argument to the function.
 
Example<?
  gregoriantojd(1,1,1);
?>
 
 Top
jddayofweek(julian_day_count, calendar_mode)
Allows you to obtain a date in various formats: as a character string or an integer. Here are all the available codes that can be passed as the calendar mode argument to the function.
 
Mode Description
 
0 The day of the week is returned in the form of a number between 0 and 6 (0 being Sunday, 1 Monday, and so on).
 
1 The day of the week taken from the Gregorian calendar is returned in the form of a character string.
 
2 The day of the week taken from the Gregorian calendar is returned in the form of an abbreviated character string.
 
Example: <?
  $julday = gregoriantojd(1,1,1);
  print(jddayofweek($julday, 1));
?>
 
 Top
jdmonthname(julian_day_count, calendar_mode)
The calendar mode argument indicates which calendar to convert the Julian day count to and what type of month name to return. Here are the main codes you can use for your month names:
 
Mode Calendar
 
0 Gregorian (abbreviated form)
 
1 Gregorian (complete form)
 
2 Julian (abbreviated form)
 
3 Julian (complete form)
 
4 Jewish
 
5 French (Republican calendar)
 
Example: <?
  $julday = gregoriantojd(1,1,1800);
  jdmonthname($julday, 5);
  ?>
 
 Top
jdtofrench(julian_day_count)
The date passed as the function argument (julian_day_count) must be in the form of a whole number which will permit you to obtain a French Republican calendar date.
 
Example<?
  $julday = gregoriantojd(1,1,1800);
  jdtofrench($julday);
?>
 
 Top
jdtogregorian(julian_day_count)
The date passed as the argument (julian_day_count) must be in the form of a whole number. It will enable you to obtain a Gregorian calendar date.
 
Example<?
  $julday = jewishtojd(1,1,1);
  jdtogregorian($julday);
?>
 
 Top
jdtojewish(julian_day_count)
The date passed as the argument (julian_day_count) must be in the form of a whole number. It will enable you to obtain a Jewish calendar date.
 
Example<?
  $julday = gregoriantojd(1,1,1);
  jdtojewish($jdc);
?>
 
 Top
jdtojulian(julian_day_count)
The date passed as the argument (julian_day_count) must be in the form of a whole number. It will enable you to obtain a Julian calendar date
 
Example<?
  $julday = gregoriantojd(1,1,1);
  jdtojulian($julday);
?>
 
 Top
jewishtojd(month, day, year)
Converts the Jewish calendar date passed as the argument into a Julian day count.
 
Example<?
  $julday = jewishtojd(1,1,1);
  jdtogregorian($julday);
?>
 
 Top
juliantojd(month, day, year)
Converts the Julian calendar date passed to the function into a Julian day count.
 
Example<?
  $julday = juliantojd(1,1,1);
  print(jdtogregorian($julday));
?>
 
 Top