首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

IntlCalendar::getFirstDayOfWeek

(PHP 5.5.0, PHP 7, PECL >= 3.0.0a1)

IntlCalendar::getFirstDayOfWeek — Get the first day of the week for the calendarʼs locale

Description

Object oriented style

代码语言:javascript
复制
public int IntlCalendar::getFirstDayOfWeek ( void )

Procedural style

代码语言:javascript
复制
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().

Parameters

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()

代码语言:javascript
复制
<?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:

代码语言:javascript
复制
int(2)
int(5)
int(1)
int(6)

See Also

  • IntlCalendar::setFirstDayOfWeek() - Set the day on which the week is deemed to start

← IntlCalendar::getErrorMessage

IntlCalendar::getGreatestMinimum →

代码语言:txt
复制
 © 1997–2017 The PHP Documentation Group

Licensed under the Creative Commons Attribution License v3.0 or later.

扫码关注腾讯云开发者

领取腾讯云代金券