alin19 Posted February 2, 2008 Share Posted February 2, 2008 this is a code that ouputs date, but it only shows 02.02.xx why? <?php echo date("H:m:s"), "\n"; set_time_limit(30); for ($i = 0; $i < 100; $i++) { sleep(10); echo date("H:m:s"),"\n"; } echo "Done!"; ?> 02:02:30 02:02:31 02:02:32 02:02:33 02:02:34 02:02:35 02:02:36 02:02:37 02:02:38 02:02:39 02:02:40 02:02:41 02:02:42 02:02:43 02:02:44 02:02:45 02:02:46 02:02:47 02:02:48 02:02:49 02:02:50 02:02:51 02:02:52 02:02:53 02:02:54 02:02:55 02:02:56 02:02:57 02:02:58 02:02:59 PHP Fatal error: Maximum execution time of 30 seconds exceeded in C:\Documents and Settings\user\Desktop\php\testjava.php on line 7 Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted February 2, 2008 Share Posted February 2, 2008 You're telling to go no more than 30 seconds with <?php set_time_limit(30); ?> so it's not. If you want to execute for more than 30 seconds change the 30 to something larger. The code "H:m:s" doesn't mean Hours:minutes:seconds, it means Hours:month:second, change it to "H:i:s" Ken Quote Link to comment Share on other sites More sharing options...
alin19 Posted February 2, 2008 Author Share Posted February 2, 2008 yes, i see that soon after i post, and modify my post, but still i recive only 02.02.xx, when the time reaches 02.02.59 it starts again from 02.02.00 Quote Link to comment Share on other sites More sharing options...
alin19 Posted February 2, 2008 Author Share Posted February 2, 2008 10x kenrbnsn, the code i have found : http://www.php.net/set_time_limit, Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted February 2, 2008 Share Posted February 2, 2008 but still i recive only 02.02.xx, when the time reaches 02.02.59 it starts again from 02.02.00 "H:m:s" doesn't mean Hours minutes seconds "H:i:s" means Hours minutes seconds. Ken Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.