Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

intlcalendar.getfirstdayofweek(3) [php man page]

INTLCALENDAR.GETFIRSTDAYOFWEEK(3)					 1					 INTLCALENDAR.GETFIRSTDAYOFWEEK(3)

IntlCalendar::getFirstDayOfWeek - Get the first day of the week for the calendars locale

	Object oriented style

SYNOPSIS
public int IntlCalendar::getFirstDayOfWeek (void ) DESCRIPTION
Procedural style int intlcal_get_first_day_of_week (IntlCalendar $cal) The week day deemed to start a week, either the default value for this locale or the value set with IntlCalendar.setFirstDayOfWeek(3). PARAMETERS
o $cal - The IntlCalendar resource. RETURN VALUES
One of the constants IntlCalendar::DOW_SUNDAY, IntlCalendar::DOW_MONDAY, , IntlCalendar::DOW_SATURDAY or FALSE on failure. EXAMPLES
Example #1 IntlCalendar.getFirstDayOfWeek(3) <?php ini_set('date.timezone', 'UTC'); $cal1 = IntlCalendar::createInstance(NULL, 'es_ES'); var_dump($cal1->getFirstDayOfWeek()); // Monday $cal1->set(2013, 1 /* February */, 3); // a Sunday var_dump($cal1->get(IntlCalendar::FIELD_WEEK_OF_YEAR)); // 5 $cal2 = IntlCalendar::createInstance(NULL, 'en_US'); var_dump($cal2->getFirstDayOfWeek()); // Sunday $cal2->set(2013, 1 /* February */, 3); // a Sunday var_dump($cal2->get(IntlCalendar::FIELD_WEEK_OF_YEAR)); // 6 The above example will output: int(2) int(5) int(1) int(6) SEE ALSO
IntlCalendar::setFirstDayOfWeek. PHP Documentation Group INTLCALENDAR.GETFIRSTDAYOFWEEK(3)

Check Out this Related Man Page

INTLCALENDAR.GETMINIMALDAYSINFIRSTWEEK(3)				 1				 INTLCALENDAR.GETMINIMALDAYSINFIRSTWEEK(3)

IntlCalendar::getMinimalDaysInFirstWeek - Get minimal number of days the first week in a year or month can have

	Object oriented style

SYNOPSIS
public int IntlCalendar::getMinimalDaysInFirstWeek (void ) DESCRIPTION
Procedural style int intlcal_get_minimal_days_in_first_week (IntlCalendar $cal) Returns the smallest number of days the first week of a year or month must have in the new year or month. For instance, in the Gregorian calendar, if this value is 1, then the first week of the year will necessarily include January 1st, while if this value is 7, then the week with January 1st will be the first week of the year only if the day of the week for January 1st matches the day of the week returned by IntlCalendar.getFirstDayOfWeek(3); otherwise it will be the previous years last week. PARAMETERS
o $cal - The IntlCalendar resource. RETURN VALUES
An int representing a number of days or FALSE on failure. EXAMPLES
Example #1 IntlCalendar.getMinimalDaysInFirstWeek(3) <?php ini_set('date.timezone', 'UTC'); ini_set('intl.default_locale', 'en_US'); $cal = new IntlGregorianCalendar(2013, 0 /* January */, 2); var_dump(IntlDateFormatter::formatObject($cal, 'cccc')); // Wednesday var_dump($cal->getMinimalDaysInFirstWeek(), // 1 $cal->getFirstDayofWeek()); // 1 (Sunday) // Week 1 of 2013 var_dump(IntlDateFormatter::formatObject($cal, "'Week 'w' of 'Y")); $cal->setMinimalDaysInFirstWeek(4); // Still Week 1 of 2013 (1st week has 5 days in the new year) var_dump(IntlDateFormatter::formatObject($cal, "'Week 'w' of 'Y")); $cal->setMinimalDaysInFirstWeek(6); // Week 53 of 2012 var_dump(IntlDateFormatter::formatObject($cal, "'Week 'w' of 'Y")); The above example will output: string(9) "Wednesday" int(1) int(1) string(14) "Week 1 of 2013" string(14) "Week 1 of 2013" string(15) "Week 53 of 2012" PHP Documentation Group INTLCALENDAR.GETMINIMALDAYSINFIRSTWEEK(3)
Man Page