ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:reference:connection:sqldate

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
v5:reference:connection:sqldate [2016/04/13 02:43] mnewnhamv5:reference:connection:sqldate [2016/04/14 15:29] – [Other Periods] document inconsistency with 'w' code dregad
Line 2: Line 2:
 ~~NOTOC~~ ~~NOTOC~~
 <WRAP right box> <WRAP right box>
-== See Also == 
 == Syntax == == Syntax ==
   string sqlDate(   string sqlDate(
Line 33: Line 32:
 |W|Week of the year as a number (1-52)| |W|Week of the year as a number (1-52)|
 |l|Day of week as full word (Monday, Tuesday, etc)| |l|Day of week as full word (Monday, Tuesday, etc)|
 +
 +<WRAP important 100%>
 +Day of week code (''w'') is not consistently implemented across DB drivers, as the library relies on database-specific functions, e.g.
 +  * [[http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_date-format|MySQL]]: 0 (Sunday) to 6 (Saturday)
 +  * MSSQL: not implemented
 +  * [[http://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements004.htm#i34924|Oracle]]: 1 to 7 (which day is 1 depends on [[https://docs.oracle.com/cd/B19306_01/server.102/b14237/initparams131.htm#REFRN10128|NLS_TERRITORY]] setting)
 +  * [[http://www.postgresql.org/docs/9.4/static/functions-formatting.html#FUNCTIONS-FORMATTING-DATETIME-TABLE|PostgreSQL]]: 1 (Sunday) to 7 (Saturday)
 +</WRAP>
  
 ===== Usage ===== ===== Usage =====
v5/reference/connection/sqldate.txt · Last modified: 2016/04/22 03:08 by mnewnham