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.SETFIRSTDAYOFWEEK(3)					 1					 INTLCALENDAR.SETFIRSTDAYOFWEEK(3)

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

	Object oriented style

SYNOPSIS
public bool IntlCalendar::setFirstDayOfWeek (int $dayOfWeek) DESCRIPTION
Procedural style bool intlcal_set_first_day_of_week (IntlCalendar $cal, int $dayOfWeek) Defines the day of week deemed to start the week. This affects the behavior of fields that depend on the concept of week start and end such as IntlCalendar::FIELD_WEEK_OF_YEAR and IntlCalendar::FIELD_YEAR_WOY. PARAMETERS
o $cal - The IntlCalendar resource. o $dayOfWeek - One of the constants IntlCalendar::DOW_SUNDAY, IntlCalendar::DOW_MONDAY, , IntlCalendar::DOW_SATURDAY. RETURN VALUES
Returns TRUE on success. Failure can only happen due to invalid parameters. EXAMPLES
Example #1 IntlCalendar.setFirstDayOfWeek(3) <?php ini_set('date.timezone', 'Europe/Lisbon'); ini_set('intl.default_locale', 'es_ES'); $cal = IntlCalendar::createInstance(); $cal->set(2013, 5 /* June */, 30); // A Sunday var_dump($cal->getFirstDayOfWeek()); // 2 (Monday) echo IntlDateFormatter::formatObject($cal, <<<EOD week of month : 'W' week of year : 'ww EOD ), " "; $cal->setFirstDayOfWeek(IntlCalendar::DOW_SUNDAY); echo IntlDateFormatter::formatObject($cal, <<<EOD week of month : 'W' week of year : 'ww EOD ), " "; The above example will output: int(2) local day of week: 7 week of month : 4 week of year : 26 local day of week: 1 week of month : 5 week of year : 27 PHP Documentation Group INTLCALENDAR.SETFIRSTDAYOFWEEK(3)
Man Page

6 More Discussions You Might Find Interesting

1. Programming

Function that gets the day of the week (0-6) ??

Hi , I am working at Unix system,using c lang. I need c fun which return the day of the week . For example : 0- Sunday. 1- Monday. .... 10x. (4 Replies)
Discussion started by: kamil
4 Replies

2. Shell Programming and Scripting

Date - Last Sunday thru Saturday

Hi All, I have to kick off a script on every Monday to get some data from database for last week (Sunday thru Saturday). If its Monday (12/12/2005) Begin date will be Sunday - 12/4/2005 End date will be Saturday - 12/10/2005 The script might not kick off on some Mondays. So my... (2 Replies)
Discussion started by: skymirror
2 Replies

3. Shell Programming and Scripting

Get day of week from cal

Hi all, I am trying to get dow from cal using below script #! /bin/bash YEAR=`echo $1 | cut -c 1-4` MONTH=`echo $1 | cut -c 5-6` DAY=`echo $1 | cut -c 7-8` for i in 1 2 3 4 5 6 7 do dayofweek=`cal $MONTH $YEAR | awk '$i == $DAY {printf("%s","$i")}'` echo $dayofweek... (4 Replies)
Discussion started by: bzylg
4 Replies

4. Shell Programming and Scripting

How to derive the last Sunday's date when Current date value is passed

Hi All, I have a requirement in my project where a batch runs on any day of a week. The input files will land to the server every Sunday. I need to read these files based on the current BUS_DAY (which falls any day of the week). For e.g : if the BUS_DAY is 20120308, we need to derive the... (3 Replies)
Discussion started by: dsfreddie
3 Replies

5. What is on Your Mind?

Place your bits!! - 2013 Academy Awards

2013 Academy Awards The nominees for the 2013 Academy Awards have been revealed in Los Angeles. The ceremony will take place at the Dolby Theatre in Hollywood, Los Angeles on 24th February. Best film Amour Argo Beasts Of The Southern Wild Django Unchained Les Miserables... (0 Replies)
Discussion started by: Yoda
0 Replies

6. Shell Programming and Scripting

Grep multiple strings in a file

Consider i have the below data in my log file. i want to grep using "Monday" and "Working" So the only output i expect is Can you help me with the grep query for Sun Sparc ? Usage: grep -hblcnsviw pattern file . . . (8 Replies)
Discussion started by: mohtashims
8 Replies