20 posts
Posted 18 December 2012 - 10:42 PM
Can I program coomand, so os.clock() change while system hour change, and os.clock() is same as system hour?
423 posts
Location
AfterLifeLochie's "Dungeon", Australia
Posted 18 December 2012 - 11:54 PM
Moved to the Ask a Pro section - it's best to ask questions like this over there, and not in General.
2088 posts
Location
South Africa
Posted 19 December 2012 - 12:36 AM
Are you asking if you can get the time of your local computer (Real life and not MC time)?
20 posts
Posted 19 December 2012 - 01:14 AM
I can get Real Life hour (my real computer time) in cc computer?
1548 posts
Location
That dark shadow under your bed...
Posted 19 December 2012 - 01:58 AM
nope, the only way to do that is to use the http interface to access the internet and get the time there
2088 posts
Location
South Africa
Posted 19 December 2012 - 03:39 AM
Yeah you would have to connect to a php website or something. I asked the same question a while back, too.
1054 posts
Posted 19 December 2012 - 04:52 AM
Indeed, easiest way is to sign up at 000webhost.com or any other hosting service and creating a file 'time.php' with simple content like this:
<?php
date_default_timezone_set('UTC'); // use correct timezone
echo date('h:i:s A', time()); // gives something like '05:12:54 PM'
?>
And in Lua something like:
local content = http.get("http://www.example/com/time.php")
local time = (content~=nil) and content.readAll() or "time server couldn't be reached"