24.11.2012, 17:20
(
Последний раз редактировалось Mellnik; 09.06.2014 в 14:46.
)
THIS PROJECT IS OUTDATED AND NO LONGER MAINTAINED. DO NOT USE IT AS IT CONTAINS SECURITY VULNERABILITIES AND BUGS.
Author: Mellnik
Current Version: v2.1
Release Date: 24/11/2012
Information
This plugin provides different time functions and time convert methods.
At the moment, there are 4 natives, I will explain them below:
(If a parameter is written in italic - it is optional)
Download:
http://files.mellnik.com/old/
Changelog:
License:
mtime is licensed under MPL 2.0
« mtime »
time plugin
v2.1
time plugin
v2.1
Author: Mellnik
Current Version: v2.1
Release Date: 24/11/2012
Information
This plugin provides different time functions and time convert methods.
At the moment, there are 4 natives, I will explain them below:
(If a parameter is written in italic - it is optional)
mtime_UnixToDate(dest[], unixseconds, date, timeformat);
Description:It simply converts UnixTime to a readable date.Example:
By default date is set to DATE_LITTLEENDIAN and timeformat to CLOCK_EUROPEAN
There are three formats for the date and two for the clock format.
Calendar date - WikipediaКод:DATE_LITTLEENDIAN -> Day.Month.Year DATE_BIGENDIAN -> Year.Month.Day DATE_MIDDLEENDIAN -> Month.Day.Year
Код:CLOCK_EUROPEAN -> Hour in 24h format:Minute:Second CLOCK_AMERICAN -> Hour in 12h format:Minute:Second (AM or PM designation)Another example:Код:new string[40]; mtime_UnixToDate(string, 1353777478); print(string); // Output: 24.11.2012 - 18:17:58
Код:new string[40]; mtime_UnixToDate(string, gettime(), DATE_MIDDLEENDIAN, CLOCK_AMERICAN); // gettime() returns current date in unixtime print(string); // Possible output: 11.24.2012 - 06:17:58 PM
mtime_ToRegularTime(dest[], msecs, bool:use_hrs);
Description:It converts milliseconds to hours:minutes:seconds:milliseconds.ExampleКод:new string[45]; mtime_ToRegularTime(string, 38193856); print(string); // Output: 10:36:33.856Код:new string[45]; mtime_ToRegularTime(string, 381938, false); print(string); // Output: 06:21.938
mtime_GetLocalTime(dest[], date, timeformat);
Description:Gets localtime of the OS. See mtime_UnixToDate() for the date and timeformat paramsExample:Код:new string[30]; mtime_GetLocalTime(string); print(string); // Possible output: 24.11.2012 - 18:44:41Код:new string[30]; mtime_GetLocalTime(string, DATE_MIDDLEENDIAN, CLOCK_AMERICAN); print(string); // Possible output: 11.24.2012 - 06:44:41 PM
mtime_GetServerUptime();
Description:Returns the uptime of the SAMP server in seconds.Example:Код:new uptime = mtime_GetServerUptime(); // uptime is now equal to the elapsed seconds since the plugin has been loaded
Download:
http://files.mellnik.com/old/
Changelog:
- v2.1 (04/08/2013)
- Fixed bugs in v2.0
- v2.0 (03/08/2013)
- Moved to github
- Redesigned some natives
- Cleaned up and improved the code
- v1.1 (28/02/2013)
- Fixed mtime_GetServerUptime() for Linux
- Removed the type param in mtime_GetServerUptime()
- Re-managed the code
- Fixed -O in makefile
- Fixed several crashes due to buffer overflows
- Optimized some code
- v1.0 (24/11/2012)
- Initial Release
License:
mtime is licensed under MPL 2.0