generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Time

Previous Thread :: Next Thread 
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
12 Jan 2014 07:21 PM
Is there any way to get the current time for the player? Can I get the time according to the time zone the player's computer is in?
Report Abuse
BlockBones2 is not online. BlockBones2
Joined: 19 Oct 2008
Total Posts: 404
12 Jan 2014 07:27 PM
I don't know how to do it but it is possible. Check out the game by BassWobble called clock.
Report Abuse
robomax11 is not online. robomax11
Joined: 07 Jul 2011
Total Posts: 6828
12 Jan 2014 07:31 PM
omg omg omg

block if u dont know how u shuldn't be in SH'ers


is called tick()

tick()

tick()

Report Abuse
BlockBones2 is not online. BlockBones2
Joined: 19 Oct 2008
Total Posts: 404
12 Jan 2014 07:31 PM
I answered half of his question and I can help others with multiple other things so please stop the sass and think before you say.
Report Abuse
VoidShredder is not online. VoidShredder
Joined: 06 Jan 2014
Total Posts: 1467
12 Jan 2014 07:32 PM
@robo if you cant read you shouldnt be in SH

He wants it according to the time zone they're in
time zone
time zone
time zone

tick() doesnt do that.
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
12 Jan 2014 07:36 PM
Correct shredder, I've seen it done before, I just don't know how to do it :(
Report Abuse
robomax11 is not online. robomax11
Joined: 07 Jul 2011
Total Posts: 6828
12 Jan 2014 07:36 PM
ahhahahah void get out


i quote the wiki

"Returns the time in UNIX time, which is the number of seconds since the Unix epoch, January 1st, 1970. This time advances without the place running, network synchronization, or wait(). Using tick() in a LocalScript may result in a different number that if you were to use it in a Script because using it in a LocalScript will fetch the user's current time while using it in a Script will fetch the server's current time. tick() is very accurate. Because of its high accuracy, it can be used to measure the time a certain function takes to execute by calling it before and after an operation has been done, then finding the difference."

omg i was right

tl;dr version :
local script using tick gets time zone time
tick in script gets sererv's time (aka pacific)
Report Abuse
Basswobble is not online. Basswobble
Joined: 18 Jul 2011
Total Posts: 3249
12 Jan 2014 07:43 PM
Excuse me, I believe that I am needed here.

tick() returns UNIX. This is the amount of seconds since the epoch on 1st of January, 1970.

You can use tick() in 2 ways:

1) On the server (Retrieves the server time)
2) On the client (Retrieves the client time).

To get the time, you need to do the following:

local secs=tick()%60
local mins=tick()%3600/60
local hours=tick()/3600%12 -- or %24, depending if you want 24 hour clock

To get a player's time, run that in a LocalScript in either Player.Backpack, Player.PlayerGui or Player.Character.


Keyboard not found. Press F1 to continue.
Report Abuse
VoidShredder is not online. VoidShredder
Joined: 06 Jan 2014
Total Posts: 1467
12 Jan 2014 07:46 PM
print(os.date)
Faster.
Report Abuse
Basswobble is not online. Basswobble
Joined: 18 Jul 2011
Total Posts: 3249
12 Jan 2014 07:47 PM
@Void

os and io libraries are set to nil in roblox.

Keyboard not found. Press F1 to continue.
Report Abuse
VoidShredder is not online. VoidShredder
Joined: 06 Jan 2014
Total Posts: 1467
12 Jan 2014 07:48 PM
sht.
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
12 Jan 2014 07:49 PM
Thanks bass
Report Abuse
BlockBones2 is not online. BlockBones2
Joined: 19 Oct 2008
Total Posts: 404
12 Jan 2014 07:50 PM
Thankyou Basswobble. I hope it wasn't too hard to find the post. Nice places by the way.
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
12 Jan 2014 07:50 PM
so it would be: print(hours:minutes:seconds)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image