diff --git a/reference/datetime/functions/checkdate.xml b/reference/datetime/functions/checkdate.xml
index 00e11ea56f..a4312b5b67 100644
--- a/reference/datetime/functions/checkdate.xml
+++ b/reference/datetime/functions/checkdate.xml
@@ -1,13 +1,13 @@
-
-
+
checkdateValidate a Gregorian date
-
- Description
+
+
+ &reftitle.description;
boolcheckdateintmonth
@@ -15,29 +15,54 @@
intyear
- Returns &true; if the date given is valid; otherwise returns &false;.
Checks the validity of the date formed by the arguments. A date
- is considered valid if:
-
-
-
- year is between 1 and 32767 inclusive
-
-
-
-
- month is between 1 and 12 inclusive
-
-
-
-
- Day is within the allowed number of
- days for the given month. Leap
- years are taken into consideration.
-
-
-
+ is considered valid if each parameter is properly defined.
+
+
+
+ &reftitle.parameters;
+
+
+
+ month
+
+
+ The month is between 1 and 12 inclusive.
+
+
+
+
+ day
+
+
+ The day is within the allowed number of days for the given
+ month. Leap years
+ are taken into consideration.
+
+
+
+
+ year
+
+
+ The year is between 1 and 32767 inclusive.
+
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns &true; if the date given is valid; otherwise returns &false;.
+
+
+
+
+ &reftitle.examples;
checkdate example
@@ -58,8 +83,15 @@ bool(false)
+
+
+
+ &reftitle.seealso;
- See also mktime and strtotime.
+
+ mktime
+ strtotime
+
diff --git a/reference/datetime/functions/date-sunrise.xml b/reference/datetime/functions/date-sunrise.xml
index 18da04e449..8ea7db64e2 100644
--- a/reference/datetime/functions/date-sunrise.xml
+++ b/reference/datetime/functions/date-sunrise.xml
@@ -1,14 +1,13 @@
-
+
date_sunrise
-
- Returns time of sunrise for a given day and location
-
+ Returns time of sunrise for a given day and location
-
- Description
+
+
+ &reftitle.description;
mixeddate_sunriseinttimestamp
@@ -20,51 +19,107 @@
date_sunrise returns the sunrise time for a given
- day (specified as a timestamp) and location. The
- latitude, longitude and
- zenith parameters default to the
- date.default_latitude,
- date.default_longitude and
- date.sunrise_zenith configuration options,
- respectively.
+ day (specified as a timestamp) and location.
+
+
+
+ &reftitle.parameters;
- The latitude defaults to North. So, if you want to
- specify a South value, you must pass a negative value. The same note
- applies to longitude, which defaults to East.
+
+
+ timestamp
+
+
+ The timestamp of the day from which the sunrise
+ time is taken.
+
+
+
+
+ format
+
+
+
+ format constants
+
+
+
+ constant
+ description
+ example
+
+
+
+
+ SUNFUNCS_RET_STRING
+ returns the result as string
+ 16:46
+
+
+ SUNFUNCS_RET_DOUBLE
+ returns the result as float
+ 16.78243132
+
+
+ SUNFUNCS_RET_TIMESTAMP
+ returns the result as integer (timestamp)
+ 1095034606
+
+
+
+
+
+
+
+
+ latitude
+
+
+ Defaults to North, pass in a negative value for South.
+ See also: date.default_latitude
+
+
+
+
+ longitude
+
+
+ Defaults to East, pass in a negative value for West.
+ See also: date.default_longitude
+
+
+
+
+ zenith
+
+
+ Default: date.sunrise_zenith
+
+
+
+
+ gmtoffset
+
+
+ Specified in hours.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
- The gmt_offset parameter is specified in hours.
+ Returns the sunrise time in a specified format on
+ success, or &false; on failure.
-
- format constants
-
-
-
- constant
- description
- example
-
-
-
-
- SUNFUNCS_RET_STRING
- returns the result as string
- 16:46
-
-
- SUNFUNCS_RET_DOUBLE
- returns the result as float
- 16.78243132
-
-
- SUNFUNCS_RET_TIMESTAMP
- returns the result as integer (timestamp)
- 1095034606
-
-
-
-
+
+
+
+ &reftitle.examples;
date_sunrise example
@@ -92,8 +147,14 @@ Mon Dec 20 2004, sunrise time : 08:54
+
+
+
+ &reftitle.seealso;
- See also date_sunset.
+
+ date_sunset
+
diff --git a/reference/datetime/functions/date-sunset.xml b/reference/datetime/functions/date-sunset.xml
index b663a3f9c2..6edbe451e9 100644
--- a/reference/datetime/functions/date-sunset.xml
+++ b/reference/datetime/functions/date-sunset.xml
@@ -1,5 +1,5 @@
-
+
date_sunset
@@ -7,8 +7,9 @@
Returns time of sunset for a given day and location
-
- Description
+
+
+ &reftitle.description;
mixeddate_sunsetinttimestamp
@@ -17,54 +18,110 @@
floatlongitudefloatzenithfloatgmt_offset
-
+
+
+ date_sunset returns the sunset time for a given
+ day (specified as a timestamp) and location.
+
+
+
+
+ &reftitle.parameters;
- date_sunset returns the sunset time for a given day
- (specified as a timestamp) and location. The
- latitude, longitude and
- zenith parameters default to the
- date.default_latitude,
- date.default_longitude and
- date.sunset_zenith configuration options,
- respectively.
+
+
+ timestamp
+
+
+ The timestamp of the day from which the sunset
+ time is taken.
+
+
+
+
+ format
+
+
+
+ format constants
+
+
+
+ constant
+ description
+ example
+
+
+
+
+ SUNFUNCS_RET_STRING
+ returns the result as string
+ 16:46
+
+
+ SUNFUNCS_RET_DOUBLE
+ returns the result as float
+ 16.78243132
+
+
+ SUNFUNCS_RET_TIMESTAMP
+ returns the result as integer (timestamp)
+ 1095034606
+
+
+
+
+
+
+
+
+ latitude
+
+
+ Defaults to North, pass in a negative value for South.
+ See also: date.default_latitude
+
+
+
+
+ longitude
+
+
+ Defaults to East, pass in a negative value for West.
+ See also: date.default_longitude
+
+
+
+
+ zenith
+
+
+ Default: date.sunrise_zenith
+
+
+
+
+ gmtoffset
+
+
+ Specified in hours.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
- The latitude defaults to North. So, if you want to
- specify a South value, you must pass a negative value. The same note
- applies to longitude, which defaults to East.
+ Returns the sunset time in a specified format on
+ success, or &false; on failure.
-
- The gmt_offset parameter is specified in hours.
-
-
- format constants
-
-
-
- constant
- description
- example
-
-
-
-
- SUNFUNCS_RET_STRING
- returns the result as string
- 16:46
-
-
- SUNFUNCS_RET_DOUBLE
- returns the result as float
- 16.78243132
-
-
- SUNFUNCS_RET_TIMESTAMP
- returns the result as integer (timestamp)
- 1095034606
-
-
-
-
+
+
+
+ &reftitle.examples;
date_sunset example
@@ -92,12 +149,19 @@ Mon Dec 20 2004, sunset time : 18:13
+
+
+
+ &reftitle.seealso;
- See also date_sunrise.
+
+ date_sunrise
+
+
-
+
dateFormat a local time/date
-
- Description
+
+
+ &reftitle.description;
stringdatestringformat
@@ -19,283 +19,320 @@
if no timestamp is given. In other words, timestamp
is optional and defaults to the value of time.
-
-
- Since PHP 5.1.1 there are a couple of useful constants of standard date/time
- formats that can be used to specify the format
- parameter.
-
-
-
-
- Timestamp of the start of the request is available in
- $_SERVER['REQUEST_TIME'] since PHP 5.1.
-
-
-
-
- The valid range of a timestamp is typically from Fri, 13 Dec
- 1901 20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT. (These are
- the dates that correspond to the minimum and maximum values for
- a 32-bit signed integer). However, before PHP 5.1 this range was limited
- from 01-01-1970 to 19-01-2038 on some systems (e.g. Windows).
-
-
-
-
- To generate a timestamp from a string representation of the date, you
- may be able to use strtotime. Additionally, some
- databases have functions to convert their date formats into timestamps
- (such as MySQL's UNIX_TIMESTAMP
- function).
-
-
+
+
+
+ &reftitle.parameters;
-
- The following characters are recognized in the
- format parameter string
-
+
+
+ format
+
+
+ The format of the outputted date string. See the formatting
+ options below.
+
+
+
+ The following characters are recognized in the
+ format parameter string
+
+
+
+ format character
+ Description
+ Example returned values
+
+
+
+
+ Day
+ ---
+ ---
+
+
+ d
+ Day of the month, 2 digits with leading zeros
+ 01 to 31
+
+
+ D
+ A textual representation of a day, three letters
+ Mon through Sun
+
+
+ j
+ Day of the month without leading zeros
+ 1 to 31
+
+
+ l (lowercase 'L')
+ A full textual representation of the day of the week
+ Sunday through Saturday
+
+
+ N
+ ISO-8601 numeric representation of the day of the week (added in
+ PHP 5.1.0)
+ 1 (for Monday) through 7 (for Sunday)
+
+
+ S
+ English ordinal suffix for the day of the month, 2 characters
+
+ st, nd, rd or
+ th. Works well with j
+
+
+
+ w
+ Numeric representation of the day of the week
+ 0 (for Sunday) through 6 (for Saturday)
+
+
+ z
+ The day of the year (starting from 0)
+ 0 through 365
+
+
+ Week
+ ---
+ ---
+
+
+ W
+ ISO-8601 week number of year, weeks starting on Monday (added in PHP 4.1.0)
+ Example: 42 (the 42nd week in the year)
+
+
+ Month
+ ---
+ ---
+
+
+ F
+ A full textual representation of a month, such as January or March
+ January through December
+
+
+ m
+ Numeric representation of a month, with leading zeros
+ 01 through 12
+
+
+ M
+ A short textual representation of a month, three letters
+ Jan through Dec
+
+
+ n
+ Numeric representation of a month, without leading zeros
+ 1 through 12
+
+
+ t
+ Number of days in the given month
+ 28 through 31
+
+
+ Year
+ ---
+ ---
+
+
+ L
+ Whether it's a leap year
+ 1 if it is a leap year, 0 otherwise.
+
+
+ o
+ ISO-8601 year number. This has the same value as
+ Y, except that if the ISO week number
+ (W) belongs to the previous or next year, that year
+ is used instead. (added in PHP 5.1.0)
+ Examples: 1999 or 2003
+
+
+ Y
+ A full numeric representation of a year, 4 digits
+ Examples: 1999 or 2003
+
+
+ y
+ A two digit representation of a year
+ Examples: 99 or 03
+
+
+ Time
+ ---
+ ---
+
+
+ a
+ Lowercase Ante meridiem and Post meridiem
+ am or pm
+
+
+ A
+ Uppercase Ante meridiem and Post meridiem
+ AM or PM
+
+
+ B
+ Swatch Internet time
+ 000 through 999
+
+
+ g
+ 12-hour format of an hour without leading zeros
+ 1 through 12
+
+
+ G
+ 24-hour format of an hour without leading zeros
+ 0 through 23
+
+
+ h
+ 12-hour format of an hour with leading zeros
+ 01 through 12
+
+
+ H
+ 24-hour format of an hour with leading zeros
+ 00 through 23
+
+
+ i
+ Minutes with leading zeros
+ 00 to 59
+
+
+ s
+ Seconds, with leading zeros
+ 00 through 59
+
+
+ Timezone
+ ---
+ ---
+
+
+ e
+ Timezone identifier (added in PHP 5.1.0)
+ Examples: UTC, GMT, Atlantic/Azores
+
+
+ I (capital i)
+ Whether or not the date is in daylights savings time
+ 1 if Daylight Savings Time, 0 otherwise.
+
+
+ O
+ Difference to Greenwich time (GMT) in hours
+ Example: +0200
+
+
+ P
+ Difference to Greenwich time (GMT) with colon between hours and minutes (added in PHP 5.1.3)
+ Example: +02:00
+
+
+ T
+ Timezone setting of this machine
+ Examples: EST, MDT ...
+
+
+ Z
+ Timezone offset in seconds. The offset for timezones west of UTC is always
+ negative, and for those east of UTC is always positive.
+ -43200 through 43200
+
+
+ Full Date/Time
+ ---
+ ---
+
+
+ c
+ ISO 8601 date (added in PHP 5)
+ 2004-02-12T15:19:21+00:00
+
+
+ r
+ RFC 2822 formatted date
+ Example: Thu, 21 Dec 2000 16:01:07 +0200
+
+
+ U
+ Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)
+ See also time
+
+
+
+
+
+
+ Unrecognized characters in the format string will be printed
+ as-is. The Z format will always return
+ 0 when using gmdate.
+
+
+
+
+ &date.timestamp.description;
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns a formatted date string. If a non-numeric value is used for
+ timestamp, &false; is returned and an
+ E_WARNING level error is emitted.
+
+
+
+
+ &reftitle.changelog;
+
+
+
- format character
- Description
- Example returned values
+ &Version;
+ &Description;
- Day
- ---
- ---
-
-
- d
- Day of the month, 2 digits with leading zeros
- 01 to 31
-
-
- D
- A textual representation of a day, three letters
- Mon through Sun
-
-
- j
- Day of the month without leading zeros
- 1 to 31
-
-
- l (lowercase 'L')
- A full textual representation of the day of the week
- Sunday through Saturday
-
-
- N
- ISO-8601 numeric representation of the day of the week (added in
- PHP 5.1.0)
- 1 (for Monday) through 7 (for Sunday)
-
-
- S
- English ordinal suffix for the day of the month, 2 characters
+ 5.1.0
- st, nd, rd or
- th. Works well with j
+ The valid range of a timestamp is typically from Fri, 13 Dec
+ 1901 20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT. (These are
+ the dates that correspond to the minimum and maximum values for
+ a 32-bit signed integer). However, before PHP 5.1.0 this range was limited
+ from 01-01-1970 to 19-01-2038 on some systems (e.g. Windows).
- w
- Numeric representation of the day of the week
- 0 (for Sunday) through 6 (for Saturday)
-
-
- z
- The day of the year (starting from 0)
- 0 through 365
-
-
- Week
- ---
- ---
-
-
- W
- ISO-8601 week number of year, weeks starting on Monday (added in PHP 4.1.0)
- Example: 42 (the 42nd week in the year)
-
-
- Month
- ---
- ---
-
-
- F
- A full textual representation of a month, such as January or March
- January through December
-
-
- m
- Numeric representation of a month, with leading zeros
- 01 through 12
-
-
- M
- A short textual representation of a month, three letters
- Jan through Dec
-
-
- n
- Numeric representation of a month, without leading zeros
- 1 through 12
-
-
- t
- Number of days in the given month
- 28 through 31
-
-
- Year
- ---
- ---
-
-
- L
- Whether it's a leap year
- 1 if it is a leap year, 0 otherwise.
-
-
- o
- ISO-8601 year number. This has the same value as
- Y, except that if the ISO week number
- (W) belongs to the previous or next year, that year
- is used instead. (added in PHP 5.1.0)
- Examples: 1999 or 2003
-
-
- Y
- A full numeric representation of a year, 4 digits
- Examples: 1999 or 2003
-
-
- y
- A two digit representation of a year
- Examples: 99 or 03
-
-
- Time
- ---
- ---
-
-
- a
- Lowercase Ante meridiem and Post meridiem
- am or pm
-
-
- A
- Uppercase Ante meridiem and Post meridiem
- AM or PM
-
-
- B
- Swatch Internet time
- 000 through 999
-
-
- g
- 12-hour format of an hour without leading zeros
- 1 through 12
-
-
- G
- 24-hour format of an hour without leading zeros
- 0 through 23
-
-
- h
- 12-hour format of an hour with leading zeros
- 01 through 12
-
-
- H
- 24-hour format of an hour with leading zeros
- 00 through 23
-
-
- i
- Minutes with leading zeros
- 00 to 59
-
-
- s
- Seconds, with leading zeros
- 00 through 59
-
-
- Timezone
- ---
- ---
-
-
- e
- Timezone identifier (added in PHP 5.1.0)
- Examples: UTC, GMT, Atlantic/Azores
-
-
- I (capital i)
- Whether or not the date is in daylights savings time
- 1 if Daylight Savings Time, 0 otherwise.
-
-
- O
- Difference to Greenwich time (GMT) in hours
- Example: +0200
-
-
- P
- Difference to Greenwich time (GMT) with colon between hours and minutes (added in PHP 5.1.3)
- Example: +02:00
-
-
- T
- Timezone setting of this machine
- Examples: EST, MDT ...
-
-
- Z
- Timezone offset in seconds. The offset for timezones west of UTC is always
- negative, and for those east of UTC is always positive.
- -43200 through 43200
-
-
- Full Date/Time
- ---
- ---
-
-
- c
- ISO 8601 date (added in PHP 5)
- 2004-02-12T15:19:21+00:00
-
-
- r
- RFC 2822 formatted date
- Example: Thu, 21 Dec 2000 16:01:07 +0200
-
-
- U
- Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)
- See also time
+ 5.1.1
+
+ There are useful constants
+ of standard date/time formats that can be used to specify the
+ format parameter.
+
-
-
-
- Unrecognized characters in the format string will be printed
- as-is. The Z format will always return
- 0 when using gmdate.
+
+
+
+
+ &reftitle.examples;
date examples
@@ -400,10 +437,37 @@ $today = date("H:i:s"); // 17:16:17
setlocale and strftime
functions instead of date.
+
+
+
+ &reftitle.notes;
+
+
+ To generate a timestamp from a string representation of the date, you
+ may be able to use strtotime. Additionally, some
+ databases have functions to convert their date formats into timestamps
+ (such as MySQL's UNIX_TIMESTAMP
+ function).
+
+
+
+
+ Timestamp of the start of the request is available in
+ $_SERVER['REQUEST_TIME'] since PHP 5.1.
+
+
+
+
+
+ &reftitle.seealso;
- See also getlastmod, gmdate,
- mktime, strftime
- and time.
+
+ getlastmod
+ gmdate
+ mktime
+ strftime
+ time
+
diff --git a/reference/datetime/functions/getdate.xml b/reference/datetime/functions/getdate.xml
index 7a03337204..4ae14ece0e 100644
--- a/reference/datetime/functions/getdate.xml
+++ b/reference/datetime/functions/getdate.xml
@@ -1,13 +1,13 @@
-
-
+
getdateGet date/time information
-
- Description
+
+
+ &reftitle.description;
arraygetdateinttimestamp
@@ -15,8 +15,27 @@
Returns an associative array containing the date
information of the timestamp, or the current
- local time if no timestamp is given, as the
- following associative array elements:
+ local time if no timestamp is given.
+
+
+
+
+ &reftitle.parameters;
+
+
+
+ &date.timestamp.description;
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns an associative array of information related to
+ the typestamp. Elements from the returned
+ associative array are as follows:
@@ -95,6 +114,10 @@
+
+
+
+ &reftitle.examples;
getdate example
@@ -127,10 +150,16 @@ Array
+
+
+
+ &reftitle.seealso;
- See also date,
- time, and
- setlocale.
+
+ date
+ time
+ setlocale
+
diff --git a/reference/datetime/functions/gettimeofday.xml b/reference/datetime/functions/gettimeofday.xml
index cc13466b02..0dd0427a8f 100644
--- a/reference/datetime/functions/gettimeofday.xml
+++ b/reference/datetime/functions/gettimeofday.xml
@@ -1,13 +1,13 @@
-
-
+
gettimeofdayGet current time
-
- Description
+
+
+ &reftitle.description;
mixedgettimeofdayboolreturn_float
@@ -17,11 +17,29 @@
associative array containing the data returned from the system
call.
+
+
+
+ &reftitle.parameters;
- Since PHP 5.1.0 there is an optional parameter,
- return_float, which makes
- gettimeofday return a float when it is set to
- &true;.
+
+
+ return_float
+
+
+ When set to &true;, a float instead of an array is returned.
+
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ By default an array is returned. If return_float
+ is set, then a foat is returned.
Array keys:
@@ -48,6 +66,34 @@
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ 5.1.0
+
+ The return_float parameter was added.
+
+
+
+
+
+
+
+
+
+ &reftitle.examples;
gettimeofday example
diff --git a/reference/datetime/functions/gmdate.xml b/reference/datetime/functions/gmdate.xml
index 48a804f264..c3f382063a 100644
--- a/reference/datetime/functions/gmdate.xml
+++ b/reference/datetime/functions/gmdate.xml
@@ -1,13 +1,13 @@
-
-
+
gmdateFormat a GMT/UTC date/time
-
- Description
+
+
+ &reftitle.description;
stringgmdatestringformat
@@ -15,11 +15,84 @@
Identical to the date function except that
- the time returned is Greenwich Mean Time (GMT). For example, when
- run in Finland (GMT +0200), the first line below prints "Jan 01
- 1998 00:00:00", while the second prints "Dec 31 1997 22:00:00".
+ the time returned is Greenwich Mean Time (GMT).
+
+
+
+
+ &reftitle.parameters;
+
+
+
+ format
+
+
+ The format of the outputted date string. See the formatting
+ options for the date function.
+
+
+
+
+ &date.timestamp.description;
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns a formatted date string. If a non-numeric value is used for
+ timestamp, &false; is returned and an
+ E_WARNING level error is emitted.
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ 5.1.0
+
+ The valid range of a timestamp is typically from Fri, 13 Dec
+ 1901 20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT. (These are
+ the dates that correspond to the minimum and maximum values for
+ a 32-bit signed integer). However, before PHP 5.1.0 this range was limited
+ from 01-01-1970 to 19-01-2038 on some systems (e.g. Windows).
+
+
+
+ 5.1.1
+
+ There are useful constants
+ of standard date/time formats that can be used to specify the
+ format parameter.
+
+
+
+
+
+
+
+
+
+ &reftitle.examples;
+
- gmdate example
+ functionname example
+
+ When run in Finland (GMT +0200), the first line below prints "Jan 01
+ 1998 00:00:00", while the second prints "Dec 31 1997 22:00:00".
+
-
-
- Prior to PHP 5.1.0, negative timestamps (dates before 1970) didn't work on
- some systems (Windows, for example).
-
-
+
+
+
+ &reftitle.seealso;
- See also date, mktime,
- gmmktime and strftime.
+
+ date
+ mktime
+ gmmktime
+ strftime
+
diff --git a/reference/datetime/functions/gmmktime.xml b/reference/datetime/functions/gmmktime.xml
index 5235736925..0ac828e6d7 100644
--- a/reference/datetime/functions/gmmktime.xml
+++ b/reference/datetime/functions/gmmktime.xml
@@ -1,13 +1,13 @@
-
-
+
gmmktimeGet Unix timestamp for a GMT date
-
- Description
+
+
+ &reftitle.description;
intgmmktimeinthour
@@ -19,32 +19,118 @@
intis_dst
- Identical to mktime except the passed
- parameters represents a GMT date.
-
-
- Parameters always represent a GMT date so is_dst
- doesn't influence the result.
+ Identical to mktime except the passed parameters represents a
+ GMT date. gmmktime internally uses mktime
+ so only times valid in derived local time can be used.
Like mktime, arguments may be left out in order
from right to left, with any omitted arguments being set to the
current corresponding GMT value.
-
-
- As of PHP 5.1.0, the is_dst parameter became
- deprecated. As a result, the new timezone handling features should be used
- instead.
-
-
+
+
+
+ &reftitle.parameters;
+
+
+
+ hour
+
+
+ The hour
+
+
+
+
+ minute
+
+
+ The minute
+
+
+
+
+ second
+
+
+ The second
+
+
+
+
+ month
+
+
+ The month
+
+
+
+
+ day
+
+
+ The day
+
+
+
+
+ year
+
+
+ The year
+
+
+
+
+ is_dst
+
+
+ Parameters always represent a GMT date so is_dst
+ doesn't influence the result.
+
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns a integer Unix timestamp.
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ 5.1.0
+
+ As of PHP 5.1.0, the is_dst parameter became
+ deprecated. As a result, the new timezone handling features should be used
+ instead.
+
+
+
+
+
+
+
+
+
+ &reftitle.examples;
-
-
- gmmktime internaly uses mktime
- so only times valid in derived local time can be used.
-
- gmmktime on Windows boundary
@@ -56,9 +142,16 @@ gmmktime(0, 0, 0, 1, 1, 1970); // valid in GMT and west, invalid in east
+
+
+
+ &reftitle.seealso;
- See also mktime,
- date and time.
+
+ mktime
+ date
+ time
+
diff --git a/reference/datetime/functions/gmstrftime.xml b/reference/datetime/functions/gmstrftime.xml
index 95b00670f1..0ec00af4c5 100644
--- a/reference/datetime/functions/gmstrftime.xml
+++ b/reference/datetime/functions/gmstrftime.xml
@@ -1,13 +1,13 @@
-
-
+
gmstrftimeFormat a GMT/UTC time/date according to locale settings
-
- Description
+
+
+ &reftitle.description;
stringgmstrftimestringformat
@@ -19,9 +19,15 @@
in Eastern Standard Time (GMT -0500), the first line below prints
"Dec 31 1998 20:00:00", while the second prints "Jan 01 1999
01:00:00".
+
+
+
+
+ &reftitle.examples;
+ gmstrftime example
-
+
+
+
+
+ &reftitle.seealso;
- See also strftime.
+
+ strftime
+
diff --git a/reference/datetime/functions/idate.xml b/reference/datetime/functions/idate.xml
index 2c0e7bc913..7ac4906dfa 100644
--- a/reference/datetime/functions/idate.xml
+++ b/reference/datetime/functions/idate.xml
@@ -1,12 +1,13 @@
-
+
idateFormat a local time/date as integer
-
- Description
+
+
+ &reftitle.description;
intidatestringformat
@@ -22,103 +23,129 @@
Unlike the function date, idate
accepts just one char in the format parameter.
+
+
+
+ &reftitle.parameters;
-
- The following characters are recognized in the
- format parameter string
-
-
-
- format character
- Description
-
-
-
-
- B
- Swatch Beat/Internet Time
-
-
- d
- Day of the month
-
-
- h
- Hour (12 hour format)
-
-
- H
- Hour (24 hour format)
-
-
- i
- Minutes
-
-
- I
- returns 1 if DST is activated,
- 0 otherwise
-
-
- L
- returns 1 for leap year,
- 0 otherwise
-
-
- m
- Month number
-
-
- s
- Seconds
-
-
- t
- Days in current month
-
-
- U
- Seconds since the Unix Epoch - January 1 1970 00:00:00 GMT -
- this is the same as time
-
-
- w
- Day of the week (0 on Sunday)
-
-
- W
- ISO-8601 week number of year, weeks starting on
- Monday
-
-
- y
- Year (1 or 2 digits - check note below)
-
-
- Y
- Year (4 digits)
-
-
- z
- Day of the year
-
-
- Z
- Timezone offset in seconds
-
-
-
-
+
+
+ format
+
+
+
+ The following characters are recognized in the
+ format parameter string
+
+
+
+ format character
+ Description
+
+
+
+
+ B
+ Swatch Beat/Internet Time
+
+
+ d
+ Day of the month
+
+
+ h
+ Hour (12 hour format)
+
+
+ H
+ Hour (24 hour format)
+
+
+ i
+ Minutes
+
+
+ I
+ returns 1 if DST is activated,
+ 0 otherwise
+
+
+ L
+ returns 1 for leap year,
+ 0 otherwise
+
+
+ m
+ Month number
+
+
+ s
+ Seconds
+
+
+ t
+ Days in current month
+
+
+ U
+ Seconds since the Unix Epoch - January 1 1970 00:00:00 GMT -
+ this is the same as time
+
+
+ w
+ Day of the week (0 on Sunday)
+
+
+ W
+ ISO-8601 week number of year, weeks starting on
+ Monday
+
+
+ y
+ Year (1 or 2 digits - check note below)
+
+
+ Y
+ Year (4 digits)
+
+
+ z
+ Day of the year
+
+
+ Z
+ Timezone offset in seconds
+
+
+
+
+
+
+
+
+ &date.timestamp.description;
+
+
-
-
- As idate always returns an integer and
- as they can't start with a "0", idate may return
- fewer digits than you would expect. See the example below:
-
-
+
+
+
+ &reftitle.returnvalues;
-
+ Returns an integer.
+
+
+ As idate always returns an integer and
+ as they can't start with a "0", idate may return
+ fewer digits than you would expect. See the example below:
+
+
+
+
+ &reftitle.examples;
+
+
+ idate example
]]>
-
+
+
+
+
+ &reftitle.seealso;
- See also date and
- time.
+
+ date
+ time
+
diff --git a/reference/datetime/functions/localtime.xml b/reference/datetime/functions/localtime.xml
index b689cb8e85..139f18a3a4 100644
--- a/reference/datetime/functions/localtime.xml
+++ b/reference/datetime/functions/localtime.xml
@@ -1,13 +1,13 @@
-
-
+
localtimeGet the local time
-
- Description
+
+
+ &reftitle.description;
arraylocaltimeinttimestamp
@@ -16,70 +16,88 @@
The localtime function returns an array
identical to that of the structure returned by the C function
- call. The first argument to localtime is
- the timestamp, if this is not given the current time as returned
- from time is used.
- The second argument to the localtime is the
- is_associative, if this is set to &false; or not
- supplied than the array is returned as a regular, numerically
- indexed array. If the argument is set to &true; then
- localtime is an associative array containing
- all the different elements of the structure returned by the C
- function call to localtime. The names of the different keys of
- the associative array are as follows:
-
-
-
- "tm_sec" - seconds
-
-
-
-
- "tm_min" - minutes
-
-
-
-
- "tm_hour" - hour
-
-
-
-
- "tm_mday" - day of the month
-
-
-
-
- "tm_mon" - month of the year, starting with 0 for January
-
-
-
-
- "tm_year" - Years since 1900
-
-
-
-
- "tm_wday" - Day of the week
-
-
-
-
- "tm_yday" - Day of the year
-
-
-
-
- "tm_isdst" - Is daylight savings time in effect
-
-
-
+ call.
-
-
- Months are from 0 (Jan) to 11 (Dec) and days of the week are from 0 (Sun) to 6 (Sat).
-
-
+
+
+
+ &reftitle.parameters;
+
+
+
+ &date.timestamp.description;
+
+
+ is_associative
+
+
+ If set to &false; or not supplied than the array is returned as a regular,
+ numerically indexed array. If the argument is set to &true; then
+ localtime is an associative array containing
+ all the different elements of the structure returned by the C
+ function call to localtime. The names of the different keys of
+ the associative array are as follows:
+
+
+
+
+
+ "tm_sec" - seconds
+
+
+
+
+ "tm_min" - minutes
+
+
+
+
+ "tm_hour" - hour
+
+
+
+
+ "tm_mday" - day of the month
+
+
+ Months are from 0 (Jan) to 11 (Dec) and days of the week are from 0 (Sun) to 6 (Sat).
+
+
+
+
+ "tm_mon" - month of the year, starting with 0 for January
+
+
+
+
+ "tm_year" - Years since 1900
+
+
+
+
+ "tm_wday" - Day of the week
+
+
+
+
+ "tm_yday" - Day of the year
+
+
+
+
+ "tm_isdst" - Is daylight savings time in effect
+
+
+
+
+
+
+
+
+
+
+
+ &reftitle.examples;
time example
diff --git a/reference/datetime/functions/microtime.xml b/reference/datetime/functions/microtime.xml
index 2c3b6c5ddc..6eaf3146aa 100644
--- a/reference/datetime/functions/microtime.xml
+++ b/reference/datetime/functions/microtime.xml
@@ -1,13 +1,13 @@
-
-
+
microtimeReturn current Unix timestamp with microseconds
-
- Description
+
+
+ &reftitle.description;
mixedmicrotimeboolget_as_float
@@ -17,23 +17,58 @@
microseconds. This function is only available on operating systems that
support the gettimeofday() system call.
+
+
+
+ &reftitle.parameters;
- When called without the optional argument, this function returns the string
- "msec sec" where sec is the current time measured in the number of
- seconds since the Unix Epoch (0:00:00 January 1, 1970 GMT), and
- msec is the microseconds part.
- Both portions of the string are returned in units of seconds.
+
+
+ get_as_float
+
+
+ When called without the optional argument, this function returns the string
+ "msec sec" where sec is the current time measured in the number of
+ seconds since the Unix Epoch (0:00:00 January 1, 1970 GMT), and
+ msec is the microseconds part.
+ Both portions of the string are returned in units of seconds.
+
+
+ If the optional get_as_float is set to
+ &true; then a float (in seconds) is returned.
+
+
+
+
+
+
+
+ &reftitle.changelog;
- When get_as_float is given, and evaluates to
- &true;, microtime will return a float.
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ 5.0.0
+
+ The get_as_float parameter was added.
+
+
+
+
+
-
-
- The get_as_float parameter was added as of
- PHP 5.0.0.
-
-
+
+
+
+ &reftitle.examples;
Timing script execution with microtime
@@ -81,8 +116,14 @@ echo "Did nothing in $time seconds\n";
+
+
+
+ &reftitle.seealso;
- See also time.
+
+ time
+
diff --git a/reference/datetime/functions/strftime.xml b/reference/datetime/functions/strftime.xml
index c604881bc0..ca664fbcad 100644
--- a/reference/datetime/functions/strftime.xml
+++ b/reference/datetime/functions/strftime.xml
@@ -1,13 +1,13 @@
-
-
+
strftimeFormat a local time/date according to locale settings
-
- Description
+
+
+ &reftitle.description;
stringstrftimestringformat
@@ -21,228 +21,250 @@
with setlocale.
- The following conversion specifiers are recognized in the format
- string:
-
-
-
- %a - abbreviated weekday name according to the current locale
-
-
-
-
- %A - full weekday name according to the current locale
-
-
-
-
- %b - abbreviated month name according to the current locale
-
-
-
-
- %B - full month name according to the current locale
-
-
-
-
- %c - preferred date and time representation for the current
- locale
-
-
-
-
- %C - century number (the year divided by 100 and truncated to
- an integer, range 00 to 99)
-
-
-
-
- %d - day of the month as a decimal number (range 01 to 31)
-
-
-
-
- %D - same as %m/%d/%y
-
-
-
-
- %e - day of the month as a decimal number, a single digit is
- preceded by a space (range ' 1' to '31')
-
-
-
-
- %g - like %G, but without the century.
-
-
-
-
- %G - The 4-digit year corresponding to the ISO week number (see %V).
- This has the same format and value as %Y, except that if the ISO week
- number belongs to the previous or next year, that year is used
- instead.
-
-
-
-
- %h - same as %b
-
-
-
-
- %H - hour as a decimal number using a 24-hour clock (range 00
- to 23)
-
-
-
-
- %I - hour as a decimal number using a 12-hour clock (range 01
- to 12)
-
-
-
-
- %j - day of the year as a decimal number (range 001 to 366)
-
-
-
-
- %m - month as a decimal number (range 01 to 12)
-
-
-
-
- %M - minute as a decimal number
-
-
-
-
- %n - newline character
-
-
-
-
- %p - either `am' or `pm' according to the given time value, or
- the corresponding strings for the current locale
-
-
-
-
- %r - time in a.m. and p.m. notation
-
-
-
-
- %R - time in 24 hour notation
-
-
-
-
- %S - second as a decimal number
-
-
-
-
- %t - tab character
-
-
-
-
- %T - current time, equal to %H:%M:%S
-
-
-
-
- %u - weekday as a decimal number [1,7], with 1 representing
- Monday
-
-
-
- Sun Solaris seems to start with Sunday as 1
- although ISO 9889:1999 (the current C standard) clearly
- specifies that it should be Monday.
-
-
-
-
-
- %U - week number of the current year as a decimal number,
- starting with the first Sunday as the first day of the first
- week
-
-
-
-
- %V - The ISO 8601:1988 week number of the current year as a
- decimal number, range 01 to 53, where week 1 is the first
- week that has at least 4 days in the current year, and with
- Monday as the first day of the week. (Use %G or %g for the year
- component that corresponds to the week number for the specified
- timestamp.)
-
-
-
-
- %W - week number of the current year as a decimal number,
- starting with the first Monday as the first day of the first
- week
-
-
-
-
- %w - day of the week as a decimal, Sunday being 0
-
-
-
-
- %x - preferred date representation for the current locale
- without the time
-
-
-
-
- %X - preferred time representation for the current locale
- without the date
-
-
-
-
- %y - year as a decimal number without a century (range 00 to
- 99)
-
-
-
-
- %Y - year as a decimal number including the century
-
-
-
-
- %Z or %z - time zone or name or abbreviation
-
-
-
-
- %% - a literal `%' character
-
-
-
-
-
- Not all conversion specifiers may be supported by your C
- library, in which case they will not be supported by PHP's
- strftime. Additionally, not all platforms
- support negative timestamps, therefore your date range may
- be limited to no earlier than the Unix epoch. This means that
- e.g. %e, %T, %R and %D (there might be more) and dates prior to
- Jan 1, 1970 will not work on Windows, some Linux
- distributions, and a few other operating systems. For Windows systems a
- complete overview of supported conversion specifiers can be found at this
- MSDN website.
-
-
+ Not all conversion specifiers may be supported by your C
+ library, in which case they will not be supported by PHP's
+ strftime. Additionally, not all platforms
+ support negative timestamps, therefore your date range may
+ be limited to no earlier than the Unix epoch. This means that
+ e.g. %e, %T, %R and %D (there might be more) and dates prior to
+ Jan 1, 1970 will not work on Windows, some Linux
+ distributions, and a few other operating systems. For Windows systems a
+ complete overview of supported conversion specifiers can be found at this
+ MSDN website.
+
+
+
+
+ &reftitle.parameters;
+
+
+
+ format
+
+
+ The following conversion specifiers are recognized in the format
+ string:
+
+
+
+ %a - abbreviated weekday name according to the current locale
+
+
+
+
+ %A - full weekday name according to the current locale
+
+
+
+
+ %b - abbreviated month name according to the current locale
+
+
+
+
+ %B - full month name according to the current locale
+
+
+
+
+ %c - preferred date and time representation for the current
+ locale
+
+
+
+
+ %C - century number (the year divided by 100 and truncated to
+ an integer, range 00 to 99)
+
+
+
+
+ %d - day of the month as a decimal number (range 01 to 31)
+
+
+
+
+ %D - same as %m/%d/%y
+
+
+
+
+ %e - day of the month as a decimal number, a single digit is
+ preceded by a space (range ' 1' to '31')
+
+
+
+
+ %g - like %G, but without the century.
+
+
+
+
+ %G - The 4-digit year corresponding to the ISO week number (see %V).
+ This has the same format and value as %Y, except that if the ISO week
+ number belongs to the previous or next year, that year is used
+ instead.
+
+
+
+
+ %h - same as %b
+
+
+
+
+ %H - hour as a decimal number using a 24-hour clock (range 00
+ to 23)
+
+
+
+
+ %I - hour as a decimal number using a 12-hour clock (range 01
+ to 12)
+
+
+
+
+ %j - day of the year as a decimal number (range 001 to 366)
+
+
+
+
+ %m - month as a decimal number (range 01 to 12)
+
+
+
+
+ %M - minute as a decimal number
+
+
+
+
+ %n - newline character
+
+
+
+
+ %p - either `am' or `pm' according to the given time value, or
+ the corresponding strings for the current locale
+
+
+
+
+ %r - time in a.m. and p.m. notation
+
+
+
+
+ %R - time in 24 hour notation
+
+
+
+
+ %S - second as a decimal number
+
+
+
+
+ %t - tab character
+
+
+
+
+ %T - current time, equal to %H:%M:%S
+
+
+
+
+ %u - weekday as a decimal number [1,7], with 1 representing
+ Monday
+
+
+
+ Sun Solaris seems to start with Sunday as 1
+ although ISO 9889:1999 (the current C standard) clearly
+ specifies that it should be Monday.
+
+
+
+
+
+ %U - week number of the current year as a decimal number,
+ starting with the first Sunday as the first day of the first
+ week
+
+
+
+
+ %V - The ISO 8601:1988 week number of the current year as a
+ decimal number, range 01 to 53, where week 1 is the first
+ week that has at least 4 days in the current year, and with
+ Monday as the first day of the week. (Use %G or %g for the year
+ component that corresponds to the week number for the specified
+ timestamp.)
+
+
+
+
+ %W - week number of the current year as a decimal number,
+ starting with the first Monday as the first day of the first
+ week
+
+
+
+
+ %w - day of the week as a decimal, Sunday being 0
+
+
+
+
+ %x - preferred date representation for the current locale
+ without the time
+
+
+
+
+ %X - preferred time representation for the current locale
+ without the date
+
+
+
+
+ %y - year as a decimal number without a century (range 00 to
+ 99)
+
+
+
+
+ %Y - year as a decimal number including the century
+
+
+
+
+ %Z or %z - time zone or name or abbreviation
+
+
+
+
+ %% - a literal `%' character
+
+
+
+
+
+
+
+ &date.timestamp.description;
+
+
+
+
+
+
+ &reftitle.examples;
+
+ This example works if you have the respective locales installed
+ in your system.
strftime locale examples
@@ -260,15 +282,6 @@ echo strftime(" in German %A.\n");
]]>
- This example works if you have the respective locales installed
- in your system.
-
-
- %G and %V, which are based on ISO 8601:1988 week numbers can
- give unexpected (albeit correct) results if the numbering system
- is not thoroughly understood. See %V above and example below.
-
- ISO 8601:1988 week number example
@@ -323,12 +336,28 @@ echo "1/3/2005 - %V,%G,%Y = " . strftime("%V,%G,%Y",strtotime("1/3/2005")) . "\n
+
+
+
+ &reftitle.notes;
+
+
+ %G and %V, which are based on ISO 8601:1988 week numbers can
+ give unexpected (albeit correct) results if the numbering system
+ is not thoroughly understood. See %V examples in this manual page.
+
+
+
+
+
+ &reftitle.seealso;
- See also setlocale,
- mktime,
- strptime,
- and the
- Open Group specification of strftime.
+
+ setlocale
+ mktime
+ strptime
+ Open Group specification of strftime
+
diff --git a/reference/datetime/functions/time.xml b/reference/datetime/functions/time.xml
index ff21054ad8..6a9b88747b 100644
--- a/reference/datetime/functions/time.xml
+++ b/reference/datetime/functions/time.xml
@@ -1,13 +1,13 @@
-
-
+
timeReturn current Unix timestamp
-
- Description
+
+
+ &reftitle.description;
inttime
@@ -16,12 +16,10 @@
Returns the current time measured in the number of seconds since
the Unix Epoch (January 1 1970 00:00:00 GMT).
-
-
- Timestamp of the start of the request is available in
- $_SERVER['REQUEST_TIME'] since PHP 5.1.
-
-
+
+
+
+ &reftitle.examples;
time example
@@ -44,8 +42,25 @@ Next Week: 2005-04-07
+
+
+
+ &reftitle.notes;
+
+
+ Timestamp of the start of the request is available in
+ $_SERVER['REQUEST_TIME'] since PHP 5.1.
+
+
+
+
+
+ &reftitle.seealso;
- See also date and microtime.
+
+ date
+ microtime
+