CodeIgniter Forums
unix_to_human - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: unix_to_human (/showthread.php?tid=21374)



unix_to_human - El Forum - 08-07-2009

[eluser]rossmurphy[/eluser]
I have this function.

Code:
function dateToHuman($timestamp) {
     return unix_to_human((string) $timestamp / 1000);
}

but when i remove (string) it returns the date as 1970? Anyone know why i need (string)??

Also, same problem when i use

Code:
date("r", $timestamp)

to return instead of unix_to_human?

I've never run into this before, why does it need a string declaration?