time

Current date, time parts, formatting.

benutzen "time".

Functions

Read the current date and time, extract parts, and format strings.

SymbolDescriptionExample
now()Unix timestamp
benutzen "time"; print time::now();
date()YYYY-MM-DD
benutzen "time"; print time::date();
clock()HH:MM:SS
benutzen "time"; print time::clock();
datetime()YYYY-MM-DD HH:MM:SS
benutzen "time"; print time::datetime();
year()Current year
benutzen "time"; print time::year();
month()Current month (1-12)
benutzen "time"; print time::month();
day()Day of month
benutzen "time"; print time::day();
hour()Hour (0-23)
benutzen "time"; print time::hour();
minute()Minute
benutzen "time"; print time::minute();
second()Second
benutzen "time"; print time::second();
weekday()Day name
benutzen "time"; print time::weekday();
monthName()Month name
benutzen "time"; print time::monthName();
format(ts, pattern)strftime-style format
benutzen "time"; var ts = time::now(); print time::format(ts, "%Y-%m-%d");