ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:reference:connection:dow

This is an old revision of the document!


dow

From Version 5.21.0-beta-2

See Also

day()
month()
year()

Syntax
string dow(
    string $fieldName,
)

Values
0Sunday
1Monday
2Tuesday
3Wednesday
4Thursday
5Friday
6Saturday

Description

The method dow() is a routine that provides a portable Day-Of-Week number from 0 to 6, starting on a Sunday. Normal day of week functions use varying start days, and offset numbers. For more information on the subject, see sqlDate().

The start day and numbering matches the PHP Date function.

Parameters

$fieldName

The date/time fieldname to be processed


Usage

$sql = "SELECT {$db->dow('birth_date')}
          FROM employees
          WHERE emp_no = 10
$dayOfWeek = $db->getOne($sql); 
v5/reference/connection/dow.1461289262.txt.gz · Last modified: 2017/04/21 11:35 (external edit)