Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

DateTime

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

DateTime

Postby bennos89 » Wed Sep 12, 2012 5:53 pm

Hi,

I have some question.

1) -> what does this code mean?
2) Back to the main topics.

I need to retrieved DateTime function from mysql. And I need to create a timer diff against the current time. If not the same, the diff timer minus 1 sec.

Currently, I am using strotime and date. To convert mysql data. However, I have error using for loop strtotime("-1 seconds", strotetime(array));
How to check the condition thanks.

3) Is there any place to read documentation of php. The official site a bit messy for me to read.
4) Explain to me. DateTime function
bennos89
New php-forum User
New php-forum User
 
Posts: 4
Joined: Wed Sep 12, 2012 4:57 pm

Re: DateTime

Postby bennos89 » Wed Sep 12, 2012 8:14 pm

This is the current code

1)While loop, connect to the database etc.
array_push($productRP, $row['timer']);

2)Store into array(DateTime from mySql)
$datetime = strtotime($c[$i][$w][4]);
$mysqldate = date("d-m-Y H:i:s", $datetime);
$c[$i][$w][4]= $mysqldate
Up to here everything seems fine. But I want to a timer. Just I need to check with the actually time.
1) Javascript
setTimeout(function() {Ajax(pTimerBoolean);},1000);

Ajax
{
//Inside is all php. ERRORS
$datetime = strtotime("-1 seconds", $c[$i][$w][4]);
$mysqldate = date("d/m/Y H:i:s", $datetime);


}

//If new DateTime is easier to do. Is there a tutorial for it?
bennos89
New php-forum User
New php-forum User
 
Posts: 4
Joined: Wed Sep 12, 2012 4:57 pm

Re: DateTime

Postby Acesystech » Thu Sep 13, 2012 11:22 pm

Acesystech
New php-forum User
New php-forum User
 
Posts: 35
Joined: Mon Aug 20, 2012 10:27 pm
Location: Ernakulam


Return to PHP coding => General

Who is online

Users browsing this forum: Bing [Bot] and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.