Current location: Hot Scripts Forums » Programming Languages » PHP » Miliseconds in PHP


Miliseconds in PHP

Reply
  #1 (permalink)  
Old 11-04-07, 11:15 AM
rodnic rodnic is offline
Newbie Coder
 
Join Date: Oct 2007
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Miliseconds in PHP

How I can get miliseconds in php equivalent in getTime() of javascript? The value of getTime diffs if I set time()*1000;

JS:
var date = new Date();
var stamp = date.getTime()/1000;


But time()*1000 or microtime() dont reurns the same data.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 11-04-07, 11:37 AM
Jay6390's Avatar
Jay6390 Jay6390 is offline
Code Master
 
Join Date: Apr 2007
Location: United Kingdom
Posts: 1,330
Thanks: 0
Thanked 0 Times in 0 Posts
Although I have only had a quick look at the microseconds function, it seems that you need to call it with true between the braces
PHP Code:

$time=microseconds(true); 

this returns a float with the time in milliseconds then a space and then the time in unix format

I just had a look at some examples on here
http://www.php.net/microtime
look for the ones that include the true between the braces

Hope this helps
Jay
__________________
Useful Tutorials
[ PHP Video-1-2-3 ] [ MySQL 1-2-3 ]
For any php function reference type

www.php.net/FunctionName
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 11-04-07, 11:45 PM
Keith's Avatar
Keith Keith is offline
Community Liaison
 
Join Date: Feb 2004
Posts: 1,232
Thanks: 1
Thanked 11 Times in 11 Posts
Quote:
Originally Posted by Jay6390 View Post
Although I have only had a quick look at the microseconds function, it seems that you need to call it with true between the braces
PHP Code:

$time=microseconds(true); 

this returns a float with the time in milliseconds then a space and then the time in unix format

I just had a look at some examples on here
http://www.php.net/microtime
look for the ones that include the true between the braces

Hope this helps
Jay
microseconds() is not a function... microtime() is, which you mention later in your reply. (???)
__________________
The toxic ZCE
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 11-05-07, 01:18 AM
Jay6390's Avatar
Jay6390 Jay6390 is offline
Code Master
 
Join Date: Apr 2007
Location: United Kingdom
Posts: 1,330
Thanks: 0
Thanked 0 Times in 0 Posts
Thats the one. sorry, was rushing to go get when i was figuring it out
__________________
Useful Tutorials
[ PHP Video-1-2-3 ] [ MySQL 1-2-3 ]
For any php function reference type

www.php.net/FunctionName
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
2 profitable script sites for sale cms-master.com General Advertisements 3 07-03-07 11:17 AM
PHP Downside--Solutions? Amulet PHP 10 07-15-05 09:26 AM
PHP multi-dimensional array sorting issue aqw PHP 2 06-25-05 12:09 AM
PHP / Graphic Developers someotherguy582 Job Offers & Assistance 1 06-05-05 08:40 PM


All times are GMT -5. The time now is 08:26 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.