JDMonthName

(PHP 4, PHP 5)

JDMonthNameRetorna o nome de um mês

Descrição

string jdmonthname ( int $julianday , int $mode )

Retorna uma "string" contendo o nome do mês. O parâmetro mode diz à função qual calendário será convertido para o formato "Julian Day Count", e o tipo do nome do mês.

Calendário (modos)
Modo Significado Valores
0 Gregoriano - abreviado Jan, Fev, Mar, Abr, Mai, Jun, Jul, Ago, Set, Out, Nov, Dez
1 Gregoriano Janeiro, Fevereiro, Março, Abril, Maio, Junho, Julho, Agosto, Setembro, Outubro, Novembro, Dezembro
2 "Julian" - abreviado Jan, Fev, Mar, Abr, Mai, Jun, Jul, Ago, Set, Out, Nov, Dez
3 "Julian" Janeiro, Fevereiro, Março, Abril, Maio, Junho, Julho, Agosto, Setembro, Outubro, Novembro, Dezembro
4 Judeu Tishri, Heshvan, Kislev, Tevet, Shevat, AdarI, AdarII, Nisan, Iyyar, Sivan, Tammuz, Av, Elul
5 Republicano Francês Vendemiaire, Brumaire, Frimaire, Nivose, Pluviose, Ventose, Germinal, Floreal, Prairial, Messidor, Thermidor, Fructidor, Extra

Parâmetros

jday

A data juliana

calendar

O calendário para obter o nome do mês

Valor Retornado

O nome do mês para a dada data juliana e calendar.

add a note add a note

User Contributed Notes 4 notes

up
3
marc at linkitdesign dot com
1 year ago
Regarding the jewish date system. It may be worth noting the following peculiarities, some obvious some not so.
1. Jewish days start at sunset NOT midnight so when converting from a Gregorian date to a Jewish one it might be worth asking if the date/time occurred 'after sunset'.
2. Jewish leap years follow a 19 year cycle which can be calculated like this:
function isJLeapYear($JYear) {
    if ( ((7 * $JYear + 1) % 19) < 7 )
        return true;
    else
        return false;
}
3. During a leap year a new leap-month called "Adar I" is inserted BEFORE the normal month of Adar.
4. During leap years, Adar is renamed "Adar II".
5. Adar/Adar II has 29 days
6. Adar I has 30 days
7. Cheshvan & Kislev have between 29 & 30 Days
8. Leap years have between 383 and 385 days.
8. non-leap years have between 353 and 355 days.
9 . In a 354-day year, months have alternating 30 and 29 day lengths.
10. In a 353-day year, the month of Kislev is reduced to 29 days.
11. In a 355-day year, the month of Cheshvan is increased to 30 days.
12. Leap years years follow the same pattern, with the addition of the 30-day Adar I as well.
up
-1
asphp at dsgml dot com
3 years ago
Use this function if you prefer to use the standard calendar constants:

<?php
function jdmonthname2($julianday, $calendar, $abbrev = false) {
  if(
$calendar == CAL_GREGORIAN && $abbrev) $mode = 0;
  elseif(
$calendar == CAL_GREGORIAN && !$abbrev) $mode = 1;
  elseif(
$calendar == CAL_JULIAN && $abbrev) $mode = 2;
  elseif(
$calendar == CAL_JULIAN && !$abbrev) $mode = 3;
  elseif(
$calendar == CAL_JEWISH) $mode = 4;
  elseif(
$calendar == CAL_FRENCH) $mode = 5;
  else
$mode = 10; //use an invalid mode and let the underlying function handle it

 
return jdmonthname($julianday, $mode);
}
?>
up
-7
viju dot kantah at gmail dot com
3 years ago
<?php

/* Simple way to get current month name */

$mons = array(1 => "Jan", 2 => "Feb", 3 => "Mar", 4 => "Apr", 5 => "May", 6 => "Jun", 7 => "Jul", 8 => "Aug", 9 => "Sep", 10 => "Oct", 11 => "Nov", 12 => "Dec");

$date = getdate();
$month = $date['mon'];

$month_name = $mons[$month];

echo
$month_name; // Displays the current month

?>
up
-6
doug at exploittheweb dot com
2 years ago
<?php

/* Simplest way to get current abbreviated month name */

echo date('M');

?>
To Top