← Scripts and libraries
ScavengeSurvive/timeutil
A collection of assorted utilities for working with timestamps and time values. Uses CTime and sscanf.
Library★ 1updated Jan 2018MITPAWNsampctl
Open on GitHubInstall with sampctl
sampctl package install ScavengeSurvive/timeutil
Run this in your project folder. sampctl downloads the package and what it depends on.
Depends on 3 packages
- sampctl/samp-stdlibnot in this directory
- southclaws/samp-ctimenot in this directory
- maddinat0r/sscanfnot in this directory
Used by 1 package
README.md
timeutil.inc
A collection of assorted utilities for working with timestamps and time values. Uses CTime and sscanf.
RoundTimestamp(timestamp, roundamount)Rounds a timestamp down to a certain unit:ROUND_TYPE_MINUTEROUND_TYPE_HOURROUND_TYPE_DAY
TimestampToDateTime(datetime, format[] = CTIME_DATE_TIME)Simple wrapper around ctime to format a timestamp.MsToString(millisecond, format[])strftimebut for millisecond durations.GetDurationFromString(string[])Returns a duration from a user-supplied string such as "3 days" or "9 minutes".
Usage
Simply add to your pawn.json and include:
{
"dependencies": ["ScavengeSurvive/timeutil"]
}
#include <timeutil>
Testing
To test, simply run the package:
sampctl package run
This page is built from what GitHub publishes about the repository. samp.directory does not host the code. Report a problem with this listing