-
Notifications
You must be signed in to change notification settings - Fork 0
cDateISO::SetWOY()
Rainer Stötter edited this page May 9, 2017
·
1 revision
public mixed libdatephp\cDate::SetWOY(integer $w, integer $wd)
- Namespace : libdatephp
- Class name: cDateISO
- This method is defined by libdatephp\cDate
SetWOY() sets the date to the monday of the $w-th week in the year and searches then the first day of week $wd
week numbers are one-based and start with 1. The first week in the year has the number 1
Example:
use libdatephp;
$dt = new cDate( 11, 23, 2016 );
$dt->SetWOY( 24 );
Example:
$dt = new \libdatephp\cDate( 4, 28, 2017 );
$dt->SetWOY( 1 );
assert( $dt->WOY( ) == 1 );
assert( $dt -> eq( new \libdatephp\cDate( 1,2,2017) ) );
$dt->SetWOY( 18 );
assert( $dt->WOY( ) == 18 );
assert( $dt -> eq( new \libdatephp\cDate( 5,1,2017) ) );
$dt->SetWOY( 19, \libdatephp\cDate::DOW_THURSDAY );
assert( $dt->IsThursday( ) );
assert( $dt->eq( new \libdatephp\cDate( 5,11,2017) ) );
- $w integer - <p>the week number to set</p>
- $wd integer - <p>the day of week to search. Defaults to DOW_MONDAY</p>
This wiki page is part of the documentation of the PHP class library libdatephp