Skip to content

cDate::SetWOQ()

Rainer Stötter edited this page May 9, 2017 · 1 revision

Method SetWOQ( )

 public   mixed libdatephp\cDate::SetWOQ(integer $w, integer $wd)

SetWOQ() sets the date to the monday of the $w-th week in the actual quarter 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:

$dt = new \libdatephp\cDate( 1, 1, 2017 );
assert( $dt->WOM( ) == 1 );
echo "\n wom = " . $dt->WOM();
$dt->GoWOM( 5 );
assert( $dt->WOM( ) == 5 );
$dt = new \libdatephp\cDate( 1, 1, 2017 );
$dt->GoWOM( 5, \libdatephp\cDate::DOW_THURSDAY );
assert( $dt->IsThursday( ) );
assert( $dt->eq( new \libdatephp\cDate( 2,2,2017) ) );

Arguments

  • $w integer - <p>the week number to set in the actual quarter</p>
  • $wd integer - <p>the day of week to search. Defaults to DOW_MONDAY</p>

See also

Clone this wiki locally