By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,409 Members | 1,604 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,409 IT Pros & Developers. It's quick & easy.

unix time stamp as float instead of integer?

P: n/a
I just noticed this when I was catching up on old posts:

Senator Jay Billington Bulworth Feb 3, 6:09 am
function getmicrotime(){
list($usec, $sec) = explode(' ', microtime());
return ((float)$usec + (float)$sec);
}

$sec should be a Unix timestamp, which is an integer. What is the point
of casting it to a float?

Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 23 May 2005 15:50:15 -0700, lk******@geocities.com wrote:
I just noticed this when I was catching up on old posts:

Senator Jay Billington Bulworth Feb 3, 6:09 am
function getmicrotime(){
list($usec, $sec) = explode(' ', microtime());
return ((float)$usec + (float)$sec);
}


$sec should be a Unix timestamp, which is an integer. What is the point
of casting it to a float?


Read: http://uk2.php.net/microtime

And observe:

$ echo '<?php print microtime() ?>' | ./php -q
0.24315700 1116889261

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.