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 Link to comment https://forums.phpfreaks.com/topic/88989-solved-datehms/ 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 Link to comment https://forums.phpfreaks.com/topic/88989-solved-datehms/#findComment-455740 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 Link to comment https://forums.phpfreaks.com/topic/88989-solved-datehms/#findComment-455742 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, Link to comment https://forums.phpfreaks.com/topic/88989-solved-datehms/#findComment-455745 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 Link to comment https://forums.phpfreaks.com/topic/88989-solved-datehms/#findComment-455750 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.