Raised This Month: $ Target: $400
 0% 

Converting a specific date to epoch


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Bladell
Senior Member
Join Date: Jun 2012
Old 07-19-2014 , 13:14   Converting a specific date to epoch
Reply With Quote #1

I want to make a plugin wich execute a certain command at a specific time. There are some cvar like:
Code:
	p_Year = register_cvar("sh_resetyear", "2014")
	p_Month = register_cvar("sh_resetmonth, "1")
	p_Day = register_cvar("sh_resetday", "1")
	p_Hour = register_cvar("sh_resethour", "1")
	p_Minute = register_cvar("sh_resetminute", "1")
	p_Second = register_cvar("sh_resetsecond", "1")
So, in 2014, first month of the year, first day of the month, first hour of the day, first minute of the hour and first second of the minute a command will be executed.
I need to transform a date into epoch time so I could use get_systime() and obatin the difference(in seconds) between today and a specific date. After I get the result of this difference I can easily find out how many days, hours, minutes and seconds are until the execution of the command, so I can show it on a hud message.
Now you know what my plugin should do. I think that this method is the best, if you know another wich is better please share it with me or help me to transform a specific date into epoch.
Bladell is offline
 



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 13:00.


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