samp.directory
← Skripte und Bibliotheken

ScavengeSurvive/timeutil

A collection of assorted utilities for working with timestamps and time values. Uses CTime and sscanf.

Bibliothek★ 1aktualisiert Jan. 2018MITPAWNsampctl
Auf GitHub öffnen

Mit sampctl installieren

sampctl package install ScavengeSurvive/timeutil

Führe das in deinem Projektordner aus. sampctl lädt das Paket und alles herunter, wovon es abhängt.

Im Pawn-Compiler ausprobieren →

Fügt seine Include-Dateien samt der Bibliotheken, von denen es abhängt, dem Pawn-Compiler in deinem Browser hinzu, bereit zum Einbinden in ein Skript.

Hängt von 3 Paketen ab

Verwendet von 1 Paket

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_MINUTE
    • ROUND_TYPE_HOUR
    • ROUND_TYPE_DAY
  • TimestampToDateTime(datetime, format[] = CTIME_DATE_TIME) Simple wrapper around ctime to format a timestamp.
  • MsToString(millisecond, format[]) strftime but 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

Diese Seite wird aus dem erstellt, was GitHub über das Repository veröffentlicht. samp.directory hostet den Code nicht. Ein Problem mit diesem Eintrag melden

ScavengeSurvive/timeutil: SA-MP Bibliothek | samp.directory