You could do this like this ( as it is faster ):
function CreateDate($day, $month, $year) {
return $year.$month.$day.'00';
}
CreateDate(04,04,2004) -> 2004040400
But make sure you add the leading zero to $month and $day ( can
be easily done (number_format for example) )
-- red
Am
Guys, second thought.
mktime builds a unix time stamp (since the unix epoch, Jan 1, 1970 [I
guess]), the difference are maybe due to time zones, because its the
number of seconds since Jan,1 1970.
On Mon, 5 Apr 2004 06:29:12 -0400, Andy B wrote:
"On my personal machine the return value is:
1081
I got 1081047600 for
$time=mktime(0,0,0,4,4,2004);
echo $time;
(RH9, PHP 4.3.4)
On Mon, 5 Apr 2004 11:34:11 +0100, Nunners wrote:
I got 1081033200
Two thoughts:
1 - is $time a global variable predefined as the current time? Don't
think
it is?!?!?!
2 - Could it be to do with local time
Woops little mistake there, first of all it's 'gmmktime()' secondly the source
should look something like:
$var = mktime ( 0,0,1,4,4,2004 ) - 1;
You can find a nice article on this topic here:
http://www.phpbuilder.com/columns/ehresman20030911.php3?page=1
-- red
[...]
> Your Server will most
Your Server will most likely run in a different timezone. If both of you
would use gmktime() the result will be the same.
As for the negative result: Had the same problem some time ago - seams
to me as if PHP doesn't like those 0,0,0 ( try 0,0,1 instead ) - You can
adjust the result by reducing th
I got 1081033200
Two thoughts:
1 - is $time a global variable predefined as the current time? Don't think
it is?!?!?!
2 - Could it be to do with local time settings i.e. comparing american dates
with UK dates (1/Aug/04 and 8/1/04)?
Nunners
> -Original Message-
> From: Andy B [mail
6 matches
Mail list logo