date of the Nth weekday of the month,
* such as the second Saturday of January 2000
*
* @param int $week the number of the week to get
* (1 = first, etc. Also can be 'last'.)
* @param int $dow the day of the week (0 = Sunday)
* @param int $month the month
* @param int $year the year. Use the complete year instead of the
* abbreviated version. E.g. use 2005, not 05.
* Do not add leading 0's for years prior to 1000.
* @param string $format the string indicating how to format the output
*
* @return string the date in the desired format
*
* @access public
* @static
*/
function NWeekdayOfMonth($week, $dow, $month, $year,
$format = DATE_CALC_FORMAT)
{
if (is_numeric($week)) {
$DOW1day = ($week - 1) * 7 + 1;
$DOW1 = Date_Calc::dayOfWeek($DOW1day, $month, $year);
$wdate = ($week - 1) * 7 + 1 + (7 + $dow - $DOW1) % 7;
if ($wdate > Date_Calc::daysInMonth($month, $year)) {
return -1;
} else {
return Date_Calc::dateFormat($wdate, $month, $year, $format);
}
} elseif ($week == 'last' && $dow < 7) {
$lastday = Date_Calc::daysInMonth($month, $year);
$lastdow = Date_Calc::dayOfWeek($lastday, $month, $year);
$diff = $dow - $lastdow;
if ($diff > 0) {
return Date_Calc::dateFormat($lastday - (7 - $diff), $month,
$year, $format);
} else {
return Date_Calc::dateFormat($lastday + $diff, $month,
$year, $format);
}
} else {
return -1;
}
}
// }}}
// {{{ isValidDate()
/**
* Returns true for valid date, false for invalid date
*
* @param int $day the day of the month
* @param int $month the month
* @param int $year the year. Use the complete year instead of the
* abbreviated version. E.g. use 2005, not 05.
* Do not add leading 0's for years prior to 1000.
*
* @return boolean
*
* @access public
* @static
*/
function isValidDate($day, $month, $year)
{
if ($year < 0 || $year > 9999) {
return false;
}
if (!checkdate($month, $day, $year)) {
return false;
}
return true;
}
// }}}
// {{{ isLeapYear()
/**
* Returns true for a leap year, else false
*
* @param int $year the year. Use the complete year instead of the
* abbreviated version. E.g. use 2005, not 05.
* Do not add leading 0's for years prior to 1000.
*
* @return boolean
*
* @access public
* @static
*/
function isLeapYear($year = 0)
{
if (empty($year)) {
$year = Date_Calc::dateNow('%Y');
}
if (preg_match('/\D/', $year)) {
return false;
}
if ($year < 1000) {
return false;
}
if ($year < 1582) {
// pre Gregorio XIII - 1582
return ($year % 4 == 0);
} else {
// post Gregorio XIII - 1582
return (($year % 4 == 0) && ($year % 100 != 0)) || ($year % 400 == 0);
}
}
// }}}
// {{{ isFutureDate()
/**
* Determines if given date is a future date from now
*
* @param int $day the day of the month
* @param int $month the month
* @param int $year the year. Use the complete year instead of the
* abbreviated version. E.g. use 2005, not 05.
* Do not add leading 0's for years prior to 1000.
*
* @return boolean
*
* @access public
* @static
*/
function isFutureDate($day, $month, $year)
{
$this_year = Date_Calc::dateNow('%Y');
$this_month = Date_Calc::dateNow('%m');
$this_day = Date_Calc::dateNow('%d');
if ($year > $this_year) {
return true;
} elseif ($year == $this_year) {
if ($month > $this_month) {
return true;
} elseif ($month == $this_month) {
if ($day > $this_day) {
return true;
}
}
}
return false;
}
// }}}
// {{{ isPastDate()
/**
* Determines if given date is a past date from now
*
* @param int $day the day of the month
* @param int $month the month
* @param int $year the year. Use the complete year instead of the
* abbreviated version. E.g. use 2005, not 05.
* Do not add leading 0's for years prior to 1000.
*
* @return boolean
*
* @access public
* @static
*/
function isPastDate($day, $month, $year)
{
$this_year = Date_Calc::dateNow('%Y');
$this_month = Date_Calc::dateNow('%m');
$this_day = Date_Calc::dateNow('%d');
if ($year < $this_year) {
return true;
} elseif ($year == $this_year) {
if ($month < $this_month) {
return true;
} elseif ($month == $this_month) {
if ($day < $this_day) {
return true;
}
}
}
return false;
}
// }}}
// {{{ dateDiff()
/**
* Returns number of days between two given dates
*
* @param int $day1 the day of the month
* @param int $month1 the month
* @param int $year1 the year. Use the complete year instead of the
* abbreviated version. E.g. use 2005, not 05.
* Do not add leading 0's for years prior to 1000.
* @param int $day2 the day of the month
* @param int $month2 the month
* @param int $year2 the year. Use the complete year instead of the
* abbreviated version. E.g. use 2005, not 05.
* Do not add leading 0's for years prior to 1000.
*
* @return int the absolute number of days between the two dates.
* If an error occurs, -1 is returned.
*
* @access public
* @static
*/
function dateDiff($day1, $month1, $year1, $day2, $month2, $year2)
{
if (!Date_Calc::isValidDate($day1, $month1, $year1)) {
return -1;
}
if (!Date_Calc::isValidDate($day2, $month2, $year2)) {
return -1;
}
return abs(Date_Calc::dateToDays($day1, $month1, $year1)
- Date_Calc::dateToDays($day2, $month2, $year2));
}
// }}}
// {{{ compareDates()
/**
* Compares two dates
*
* @param int $day1 the day of the month
* @param int $month1 the month
* @param int $year1 the year. Use the complete year instead of the
* abbreviated version. E.g. use 2005, not 05.
* Do not add leading 0's for years prior to 1000.
* @param int $day2 the day of the month
* @param int $month2 the month
* @param int $year2 the year. Use the complete year instead of the
* abbreviated version. E.g. use 2005, not 05.
* Do not add leading 0's for years prior to 1000.
*
* @return int 0 if the dates are equal. 1 if date 1 is later, -1 if
* date 1 is earlier.
*
* @access public
* @static
*/
function compareDates($day1, $month1, $year1, $day2, $month2, $year2)
{
$ndays1 = Date_Calc::dateToDays($day1, $month1, $year1);
$ndays2 = Date_Calc::dateToDays($day2, $month2, $year2);
if ($ndays1 == $ndays2) {
return 0;
}
return ($ndays1 > $ndays2) ? 1 : -1;
}
// }}}
}
// }}}
/*
* Local variables:
* mode: php
* tab-width: 4
* c-basic-offset: 4
* c-hanging-comment-ender-p: nil
* End:
*/
?> nte scritto Direttamente in Merito uno Pratica racconto, gli studenti Hanno la documentazione Loro immediato per effettuare I loro compiti o pratiche inerenti la sezione discutere." closure_hashcode_dr223r="19">Incluso en aquellos que no tienen casi el vendedor por escrito directamente en una práctica novedosa, los estudiantes tienen la documentación a sus tareas inmediatas o llevar a cabo sus prácticas relativas a la sección de debate. E 'una importancia fundamental la tarea de la evolución documento del loro - o la filosofía de discutir las prácticas implicadas - y, en general, su profesor para promover un público más amplio preparato.Tuttavia de ancho y, en el caso de Usui Reiki, no Essern que se estime oportuno.
Usui Sensei era un libro o escrito libros sobre el tema, nadie ha descubierto todavía estafas ELLOS.
Tenemos el mejor, es un período breve entrevista en la que responder a algunas preguntas sobre el arte de la curación - pero sin dar detalles de la práctica de la precisión.
Libros reales, tengo entendido que todavía hay alrededor de la "Guía" (Compilado por Chūjirō Hayashi), mientras que los alumnos de Usui Sensei no parecía haber escrito algo sobre Reiki Usui (no habría estudiantes en un caso excepcional que parece he escrito algo en el arte de curar con las manos, son: Kaiji Tomita y Toshihiro Eguchi), en esta sección para encontrar lo que POTRET encontrado poca documentación d