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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.