ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:datetime:adodb_date

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
datetime:adodb_date [2015/11/26 15:09] mnewnhamv5:datetime:adodb_date [2016/01/13 02:12] – ↷ Page moved from datetime:adodb_date to v5:datetime:adodb_date mnewnham
Line 5: Line 5:
 [[http://php.net/manual/en/function.date.php|PHP Function date()]] [[http://php.net/manual/en/function.date.php|PHP Function date()]]
 == Syntax == == Syntax ==
-  int adodb_time()+  string adodb_date( 
 +      string $format, 
 +      optional mixed $timestamp = false 
 +  )
 </WRAP> </WRAP>
 ===== Description ===== ===== Description =====
  
 +This function converts a timestamp to a formatted local date. If ''$timestamp'' is not defined, the current timestamp is used. Unlike the function date(), it supports dates outside the 1901 to 2038 range. To produce a date prior to the epoch date, a negative number of seconds prior to that number can be provided
 +-------------------------------------
 +===== Usage ======
 +<code php>
 +print adodb_date('d/m/Y');
 +/*
 +* Prints 03/12/2015
 +*/
  
-Convert a timestamp to a formatted local date. If $timestamp is not defined, the current timestamp is used. Unlike the function date(), it supports dates outside the 1901 to 2038 range.The format fields that adodb_date supports: +print adodb_date('d/m/Y',0)
- a - "am" or "pm" +/* 
- A - "AM" or "PM" +* Prints 12/31/1969 
- d - day of the month, 2 digits with leading zeros; i.e. "01" to "31" +*/ 
- D - day of the week, textual, 3 letters; e.g. "Fri" + 
- F - month, textual, long; e.g. "January" +print adodb_date('d/m/Y'-27454896000); 
- g - hour, 12-hour format without leading zeros; i.e. "1" to "12" +/* 
- G - hour, 24-hour format without leading zeros; i.e. "0" to "23" +* Prints 12/21/1099 
- h - hour, 12-hour format; i.e. "01" to "12" +*/ 
- H - hour, 24-hour format; i.e. "00" to "23" +</code> 
- i - minutes; i.e. "00" to "59" +===== Available Formats ===== 
- j - day of the month without leading zeros; i.e. "1" to "31" +The format fields that adodb_date supports: 
- l (lowercase 'L') - day of the week, textual, long; e.g. "Friday" + 
- L - boolean for whether it is a leap year; i.e. "0" or "1" +  a - "am" or "pm" 
- m - month; i.e. "01" to "12" +  A - "AM" or "PM" 
- M - month, textual, 3 letters; e.g. "Jan" +  d - day of the month, 2 digits with leading zeros; i.e. "01" to "31" 
- n - month without leading zeros; i.e. "1" to "12" +  D - day of the week, textual, 3 letters; e.g. "Fri" 
- O - Difference to Greenwich time in hours; e.g. "+0200" +  F - month, textual, long; e.g. "January" 
- Q - Quarter, as in 1, 2, 3, 4 +  g - hour, 12-hour format without leading zeros; i.e. "1" to "12" 
- r - RFC 2822 formatted date; e.g. "Thu, 21 Dec 2000 16:01:07 +0200" +  G - hour, 24-hour format without leading zeros; i.e. "0" to "23" 
- s - seconds; i.e. "00" to "59" +  h - hour, 12-hour format; i.e. "01" to "12" 
- S - English ordinal suffix for the day of the month, 2 characters+  H - hour, 24-hour format; i.e. "00" to "23" 
-     i.e. "st", "nd", "rd" or "th" +  i - minutes; i.e. "00" to "59" 
- t - number of days in the given month; i.e. "28" to "31" +  j - day of the month without leading zeros; i.e. "1" to "31" 
- T - Timezone setting of this machine; e.g. "EST" or "MDT" +  (lowercase 'L') - day of the week, textual, long; e.g. "Friday" 
- U - seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) +  L - boolean for whether it is a leap year; i.e. "0" or "1" 
- w - day of the week, numeric, i.e. "0" (Sunday) to "6" (Saturday) +  m - month; i.e. "01" to "12" 
- Y - year, 4 digits; e.g. "1999" +  M - month, textual, 3 letters; e.g. "Jan" 
- y - year, 2 digits; e.g. "99" +  n - month without leading zeros; i.e. "1" to "12" 
- z - day of the year; i.e. "0" to "365" +  O - Difference to Greenwich time in hours; e.g. "+0200" 
- Z - timezone offset in seconds (i.e. "-43200" to "43200"). +  Q - Quarter, as in 1, 2, 3, 4 
-     The offset for timezones west of UTC is always negative, +  r - RFC 2822 formatted date; e.g. "Thu, 21 Dec 2000 16:01:07 +0200" 
- and for those east of UTC is always positive. +  s - seconds; i.e. "00" to "59" 
-Unsupported+  S - English ordinal suffix for the day of the month,  
- B - Swatch Internet time +      2 characters i.e. "st", "nd", "rd" or "th" 
- I (capital i) - "1" if Daylight Savings Time, "0" otherwise. +  t - number of days in the given month; i.e. "28" to "31" 
- W - ISO-8601 week number of year, weeks starting on Monday+  T - Timezone setting of this machine; e.g. "EST" or "MDT" 
 +  U - seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) 
 +  w - day of the week, numeric, i.e. "0" (Sunday) to "6" (Saturday) 
 +  Y - year, 4 digits; e.g. "1999" 
 +  y - year, 2 digits; e.g. "99" 
 +  z - day of the year; i.e. "0" to "365" 
 +  Z - timezone offset in seconds (i.e. "-43200" to "43200"). 
 +      The offset for timezones west of UTC is always negative,  
 +      and for those east of UTC is always positive. 
 + 
 +The following formats are unsupported
 + 
 +  B - Swatch Internet time 
 +  (capital i) - "1" if Daylight Savings Time, "0" otherwise. 
 +  W - ISO-8601 week number of year, weeks starting on Monday 
 +   
 +  
v5/datetime/adodb_date.txt · Last modified: 2023/05/18 18:55 by dregad