Sign in to follow this  
Followers 0
Mejedin

Server's Time

11 posts in this topic

How would one go about finding the a given server's time?

0

Share this post


Link to post
Share on other sites
How would one go about finding the a given server's time?

what os is the server running?

0

Share this post


Link to post
Share on other sites

...and how accurately do you want to measure it?

Mungewell.

0

Share this post


Link to post
Share on other sites

I would like to get as precise as possible, but I guess terminating after seconds is close enough.

Let's just assume, q.e.d., that the OS is PHP. How would you find it's time? Does the OS make a difference, if so, how?

0

Share this post


Link to post
Share on other sites

http://us3.php.net/time

int time ( void )

<?php
$nextWeek = time() + (7 * 24 * 60 * 60);
// 7 days; 24 hours; 60 mins; 60secs
echo 'Now: '. date('Y-m-d') ."\n";
echo 'Next Week: '. date('Y-m-d', $nextWeek) ."\n";
// or using strtotime():
echo 'Next Week: '. date('Y-m-d', strtotime('+1 week')) ."\n";
?>

also microtime() might be of use

http://us3.php.net/manual/en/function.microtime.php

0

Share this post


Link to post
Share on other sites
Let's just assume, q.e.d., that the OS is PHP. How would you find it's time? Does the OS make a difference, if so, how?
Well, That's a pretty big assumption... considering PHP isn't an operating system. :roll:
0

Share this post


Link to post
Share on other sites
http://us3.php.net/time

int time ( void )

<?php
$nextWeek = time() + (7 * 24 * 60 * 60);
// 7 days; 24 hours; 60 mins; 60secs
echo 'Now: '. date('Y-m-d') ."\n";
echo 'Next Week: '. date('Y-m-d', $nextWeek) ."\n";
// or using strtotime():
echo 'Next Week: '. date('Y-m-d', strtotime('+1 week')) ."\n";
?>

also microtime() might be of use

http://us3.php.net/manual/en/function.microtime.php

Where do I implement this code? Where do I put it?

0

Share this post


Link to post
Share on other sites

Paste it into a .php file and run it on a server.

0

Share this post


Link to post
Share on other sites
Paste it into a .php file and run it on a server.

Would that require me having FTP access to this server? Or is there a way to run a file remotely?

0

Share this post


Link to post
Share on other sites

Upload it via FTP, then run the file from your browser.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0