Stay informed -
Newsletter Signup
Convert timetsamp to text
Dated Added: 19th October 2007
This script converts a timestamp or any given numeric value into the written form
Copy Code:
<?php function timeTOtext($timestamp) { $units = array ( 86400 => 'days', 3600 => 'hours', 60 => 'minutes', 1 => 'secs' ); $out = ''; foreach($units as $timestamp => $txt ) { $t = floor($secs / $timestamp); if( $t > 0 ) { $secs -= ($t * $timestamp ); $out .= $t . ' ' . $txt . ' '; } } return $out; } echo 'Example: '.timeTOtext(1000); ?>
Script Updates
Ajax
ASP
ASP.NET
CSS
HTML
Java
Javascript
PHP
Python
Ruby on Rails
Useful Tools
XML
Request Help
Request a Script
Request WebDev
Contact Us
About Us
Ajax Scripts | ASP Scripts | ASP.NET Scripts | HTML Scripts | Javascript Scripts | PHP Scripts | Python Scripts | Ruby on Rails Scripts | XML Scripts
2001-2007 © All Rights Reserved. 3Branch Internet Development. All content is available under the GPL