This topic is locked

Adding 6 hours in Current Time

4/29/2011 6:40:15 PM
PHPRunner General questions
F
fawad112 author

Hi,
I am trying to add 6 hours in my current time when someone adds a record. I usually do this in PHP by Using the following code.

$check1 = strtotime('now');

$finaldate = date("Y-m-d H:i:s", $check1 + 21600);


But it does not seem to work in PHPRUNNer. It is giving me current time only.

How does it work in Phprunner ?
Thanks for your help.

Admin 4/30/2011

If it works in plain PHP code it should work in PHPRunner as well.
If you need help post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.

C
CodeDog 4/30/2011

fawad,
If you're just talking about a default value in a time field for a new record you can use:
date("Y-m-d H:i:s",strtotime("+6 hours"))
Either Sergey or Marie gave me this answer some time back...
Edited: said date field and meant time field...

Admin 4/30/2011

CodeDog,
good catch.
I was actually looking for an explanation of what "it does not seem to work in PHPRUNNer" means. My guess OP is talking about events.

C
CodeDog 4/30/2011

Thanks Sergey. And yes, since I'd already asked the question once I picked up on what fawad was asking right away. The answer originally came from your side, though... <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=58003&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />