From 67963fd9760ab9ac9aa7a7c2ba7b09cba0f58456 Mon Sep 17 00:00:00 2001 From: Matt Li Date: Fri, 3 Jun 2005 08:46:16 +0000 Subject: [PATCH] Fix 33223 and move to new doc style git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@187558 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/datetime/functions/mktime.xml | 201 +++++++++++++++++------- 1 file changed, 145 insertions(+), 56 deletions(-) diff --git a/reference/datetime/functions/mktime.xml b/reference/datetime/functions/mktime.xml index 01469aae7f..cb764cd0ac 100644 --- a/reference/datetime/functions/mktime.xml +++ b/reference/datetime/functions/mktime.xml @@ -1,13 +1,14 @@ - + mktime Get Unix timestamp for a date - - Description + + + &reftitle.description; intmktime inthour @@ -18,13 +19,6 @@ intyear intis_dst - - Warning: Note the strange order of - arguments, which differs from the order of arguments in a regular - Unix mktime() call and which does not lend itself well to leaving - out parameters from right to left (see below). It is a common - error to mix these values up in a script. - Returns the Unix timestamp corresponding to the arguments given. This timestamp is a long integer containing the number of @@ -36,33 +30,129 @@ arguments thus omitted will be set to the current value according to the local date and time. + + + + &reftitle.parameters; - is_dst can be set to 1 if the time is - during daylight savings time (DST), 0 if it is not, or -1 (the default) - if it is unknown whether the time is within daylight savings time - or not. If it's unknown, PHP tries to figure it out itself. This can - cause unexpected (but not incorrect) results. + + + hour + + + The number of the hour. + + + + + minute + + + The number of the minute. + + + + + second + + + The number of seconds past the minute. + + + + + month + + + The number of the month. + + + + + day + + + The number of the day. + + + + + year + + + The number of the year, may be a two or four digit value, + with values between 0-69 mapping to 2000-2069 and 70-99 to + 1970-1999 (on systems where time_t is a 32bit signed integer, as + most common today, the valid range for year + is somewhere between 1901 and 2038). + + + + + is_dst + + + This parameter can be set to 1 if the time is during daylight savings time (DST), + 0 if it is not, or -1 (the default) if it is unknown whether the time is within + daylight savings time or not. If it's unknown, PHP tries to figure it out itself. + This can cause unexpected (but not incorrect) results. + Some times are invalid if DST is enabled on the system PHP is running on or + is_dst is set to 1. If DST is enabled in e.g. 2:00, all times + between 2:00 and 3:00 are invalid and mktime returns an undefined + (usually negative) value. + Some systems (e.g. Solaris 8) enable DST at midnight so time 0:30 of the day when DST + is enabled is evaluated as 23:30 of the previous day. + + + + + + + + + &reftitle.returnvalues; - Some times are invalid if DST is enabled on the system PHP is running on - or is_dst is set to 1. If DST is enabled in e.g. - 2:00, all times between 2:00 and 3:00 are invalid and - mktime returns an undefined (usually negative) value. - Some systems (e.g. Solaris 8) enable DST at midnight so time 0:30 - of the day when DST is enabled is evaluated as 23:30 of the previous day. + mktime returns the Unix timestamp of the arguments + given. + If the arguments are invalid (eg. if the year, month and day are all 0), the + function returns -1. - - - is_dst was added in 3.0.10. - - + + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + + 3.0.10 + Added is_dst parameter + + + + + + + + + &reftitle.examples; - mktime is useful for doing date arithmetic - and validation, as it will automatically calculate the correct - value for out-of-range input. For example, each of the following - lines produces the string "Jan-01-1998". <function>mktime</function> example + + mktime is useful for doing date arithmetic + and validation, as it will automatically calculate the correct + value for out-of-range input. For example, each of the following + lines produces the string "Jan-01-1998". + - Year may be a two or four digit value, - with values between 0-69 mapping to 2000-2069 and 70-99 to - 1970-1999 (on systems where time_t is a 32bit signed integer, as - most common today, the valid range for - year is somewhere between 1901 and 2038). - - Windows - - Negative timestamps are not supported under any known version - of Windows. Therefore the range of valid years includes only 1970 - through 2038. - - - - - The last day of any given month can be expressed as the "0" day - of the next month, not the -1 day. Both of the following examples - will produce the string "The last day in Feb 2000 is: 29". Last day of next month + + The last day of any given month can be expressed as the "0" day + of the next month, not the -1 day. Both of the following examples + will produce the string "The last day in Feb 2000 is: 29". + @@ -109,14 +185,27 @@ echo strftime("Last day in Feb 2000 is: %d", $lastday); - - Date with year, month and day equal to zero is considered illegal - (otherwise it what be regarded as 30.11.1999, which would be strange - behavior). - + + + + &reftitle.notes; + + + Negative timestamps are not supported under any known version + of Windows. Therefore the range of valid years includes only 1970 + through 2038. + + + + + + &reftitle.seealso; - See also gmmktime, - date and time. + + gmmktime + date + time +