Refactor
:my
=>
'code'
Codes
Refactorings
Popular
Best
Submit
Spam
Account
Logout
Login
JavaScript doesn't seem to be activated, expect things to be ugly and sloppy!
More Jobs
Recent
Arrays, loops, strings...
Similar virtual attributes and their getters/setter
Check type is XML Serializable
Serena Collage slideshow
Shortest regular expression for matching a subdomain.
Caching Methods
Tab-Switching in jQuery
Apache log file sorting
How to find max, min of three numbers?
repeated code in rspec model test
Popular
Caching Methods
How to find max, min of three numbers?
Similar virtual attributes and their getters/setter
Shortest regular expression for matching a subdomain.
Arrays, loops, strings...
Check type is XML Serializable
Apache log file sorting
Tab-Switching in jQuery
Serena Collage slideshow
A simple factorial program.
Pastable version of
Adding seconds to a MySQL timestamp
<div style="overflow:auto;border:solid 1px #ccc;background:#000;color:#F8F8F8"> <div class="section"> <pre style="float:left;margin:0 10px;border-right:0;color:#666;">1 2 3 4 5 6 7 8 9 10 11</pre> <pre class="sunburst">/** * Split the supplied timestamp string, add the seconds and concatenate the whole thing back into timestamp format. * Note! that the mktime function will perform even if the supplied amount of seconds exceeds 59. It just adds them * as minutes, hours, days, etc. and returns the Unix timestamp from which we can form the MySQL timestamp. */ function addSecondsToTimestamp ($_timestamp, $_amount) { ist($year, $month, $day, $hours, $minutes, $seconds) = preg_split("/-| |:/i", $_timestamp); $seconds += $_amount; return date('Y-m-d H:i:s', mktime($hours, $minutes, $seconds, $month, $day, $year)); } </pre> </div> </div> <a href="http://refactormycode.com/codes/363-adding-seconds-to-a-mysql-timestamp" style="color:#fff" title="As seen on RefactorMyCode.com"><img alt="Small_logo" src="http://refactormycode.com/images/small_logo.gif" style="border:0" /></a>