Raised This Month: $ Target: $400
 0% 

Time difference


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 06-12-2010 , 10:30   Re: Time difference
Reply With Quote #1

Yeah, I can do it with timestamp, just couldn't find that.

Can you show me an example of how to get the difference?
Backstabnoob is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-12-2010 , 10:37   Re: Time difference
Reply With Quote #2

Quote:
Originally Posted by Backstabnoob View Post
Yeah, I can do it with timestamp, just couldn't find that.

Can you show me an example of how to get the difference?
All you have to do is subtract one time from the other then divide by X to determine the difference in years, months, days, hours, minutes, seconds or w\e.

Use get_systime() in your plugin to get the current unix time.

Current time = 1276338840
5 hours from now = 1276356840

1276356840 - 1276338840 = 18000

MinuteSeconds = 60
HourSeconds = 3600
DaySeconds = 86400

18000 / 3600 = 5
__________________
Bugsy is offline
Reply



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 On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:48.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode