Re: [PHP] mktime error

2004-04-05 Thread Red Wingate
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

[PHP] mktime error

2004-04-05 Thread Andy B
if you need to turn the result of mktime() into a valid mysql timestamp format then put these 2 lines in your code when needed: http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] mktime error

2004-04-05 Thread Hernan Marino
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

RE: [PHP] mktime error

2004-04-05 Thread Hernan Marino
time settings i.e. comparing american dates with UK dates (1/Aug/04 and 8/1/04)? Nunners > -Original Message- > From: Andy B [mailto:[EMAIL PROTECTED] > Sent: 05 April 2004 11:29 > To: [EMAIL PROTECTED] > Subject: [PHP] mktime error > > "On my perso

Re: [PHP] mktime error

2004-04-05 Thread Red Wingate
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

Re: [PHP] mktime error

2004-04-05 Thread Red Wingate
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

RE: [PHP] mktime error

2004-04-05 Thread Nunners
rom: Andy B [mailto:[EMAIL PROTECTED] > Sent: 05 April 2004 11:29 > To: [EMAIL PROTECTED] > Subject: [PHP] mktime error > > "On my personal machine the return value is: > > 1081026000" > interesting... i got 1081054800 from mine with the code: > $time=mktime(0,0,0

[PHP] mktime error

2004-04-05 Thread Andy B
"On my personal machine the return value is: 1081026000" interesting... i got 1081054800 from mine with the code: even on cli it gives the same thing -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] mktime error

2004-04-05 Thread Andrew
Hi there, On a host running: PHP 4.3.5 (cli) (built: Apr 3 2004 07:11:21) I found a strange error produced by the mktime() function: mktime(0, 0, 0, 4, 4, 2004) returns -7262 On my personal machine the return value is: 1081026000 If anybody's aware of that bug and if it's fixed, please answe