Jump to content

[SOLVED] date("H:m:s")


alin19

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.