[INC] Unix Time by Bugsy - Ported to SourceMod
1 Attachment(s)
I have used this in my Amx ModX plugins. Today I needed same functionality in my Source Mod plugin, so I decided to port this include to new Source Mod syntax to be able to use it. I hope that you will find it useful as it is useful for my purposes, and I want to thank Bugsy for creating this awesome include :) Originally made by Bugsy for Amx ModX. Original theme with more informations: https://forums.alliedmods.net/showthread.php?t=91915 Example usage: PHP Code:
http://i.imgur.com/qwa6h3n.png Here are 2 useful functions written by me, which can be improved :) TO DO: Add regex checks PHP Code:
|
Re: [INC] Unix Time by Bugsy - Ported to SourceMod
Thanks!
|
Re: [INC] Unix Time by Bugsy - Ported to SourceMod
L 03/27/2021 - 14:53:05: [SM] Exception reported: Array index out-of-bounds (index 12, limit 12)
L 03/27/2021 - 14:53:05: [SM] Blaming: caseopening.smx L 03/27/2021 - 14:53:05: [SM] Call stack trace: L 03/27/2021 - 14:53:05: [SM] [1] Line 249, D:\Steam-server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\includ e\unixtime_sourcemod.inc::SecondsInMonth L 03/27/2021 - 14:53:05: [SM] [2] Line 204, D:\Steam-server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\includ e\unixtime_sourcemod.inc::TimeToUnix |
Re: [INC] Unix Time by Bugsy - Ported to SourceMod
1 Attachment(s)
Since this inc has ~1000 downloads, here are my 2 cents:
1. TZ offset calc in GetTimeZone() is wrong: PHP Code:
2. imagine local_unix->local_datetime->(change hour?)->local_unix, in TimeToUnix( using UT_TIMEZONE_SERVER ) there should be -, not + (double check my logic, timezones = minefield) PHP Code:
Fixed inc: |
Re: [INC] Unix Time by Bugsy - Ported to SourceMod
If some one want fancy time formats and calculations,
you can connect into SM extension sqlite and perhaps do fastcall query. https://www.sqlite.org/lang_datefunc.html |
All times are GMT -4. The time now is 16:06. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.