Jump to content

Archived

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

urbandsigns.com

Need help adding seconds to time

Recommended Posts

Is this what you're looking for: [code]<?php
$time = '13:15:07';
echo "Time: {$time}<br />";
$new_time = date('H:i:s',strtotime($time)+8); // adds 8 seconds
echo "New time: {$new_time}";
?>[/code]

It would generate the output: [code]Time: 13:15:07
New time: 13:15:15[/code]

Share this post


Link to post
Share on other sites
Thanks for the response, but this isn't adding correctly. Here is my code based on what you posted:
[code]$total2 = date('H:i:s',strtotime($_GET["score"])+$_GET["cones"]);[/code]

Scores: 00:33:26
Cones: 39
Total2: 00:34:05

Share this post


Link to post
Share on other sites

×

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.