Repository navigation
TimeParse
imshooter edited this page Nov 26, 2026
·
2 revisions
Read a time from text.
native bool:TimeParse(const string[], const format[], &Timestamp:output, const zone[] = "");| Parameter | Description |
|---|---|
const string[] |
The text. |
const format[] |
How it is written, with the specifiers in Specifiers. |
&Timestamp:output |
The time read. |
const zone[] |
The time zone of the text, or the zone of the server when left out. |
-
truewhen it was read. -
falsewhen the text does not match the format, names no whole date, does not fit aTimestamp, or there is no such zone.outputis left as it was.
It reads every specifier of TimeFormat, and a width before one, as %4Y, is the most digits it takes. An offset in the text, with %z, wins over the zone. A time of day left out is midnight, and text after the format is left alone. A time the clocks skip or repeat is taken as the earliest it can be.
stock bool:ReadEventStart(const text[], &Timestamp:start) {
return TimeParse(text, "%d/%m/%Y %H:%M", start);
}- TimeFormat: Write a time as text.
- MakeTimestamp: The time of a date.
Chrono 0.2.0 · Repository · Releases · MIT License
Guides
Reference
Functions