From 1a891a9b986d5c82611b8e28d423d834618f39d6 Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Mon, 28 Jun 2004 15:04:02 +0000 Subject: [PATCH] add an explanation and an example about problems in two digits years git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@162237 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/datetime/functions/idate.xml | 35 +++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/reference/datetime/functions/idate.xml b/reference/datetime/functions/idate.xml index f1743f7e2d..e593a64b7f 100644 --- a/reference/datetime/functions/idate.xml +++ b/reference/datetime/functions/idate.xml @@ -1,5 +1,5 @@ - + idate @@ -17,14 +17,18 @@ Returns a string formatted according to the given format string using the given integer timestamp or the current local time - if no timestamp is given. In otherwords, timestamp + if no timestamp is given. In other words, timestamp is optional and defaults to the value of time. + + Unlike the function date, idate + accepts just one char in the format parameter. + The following characters are recognized in the <parameter>format</parameter> parameter string - + format character @@ -90,7 +94,7 @@ y - Year (2 digits) + Year (1 or 2 digits - check note below) Y @@ -108,6 +112,29 @@
+ + + As idate returns always an integer and + as they can't start with a "0", idate may return less + digits then you would expect. See the example below: + + + + + + +]]> + + + See also date and time.