Class System.Time

A system date/time

Constructors

Time() create a new date with the current time
Time(string iso) create a new date from an ISO-8601 string
Time(integer year, integer month, integer day, integer hour, integer minute, integer second) create a new date

Properties

year the year of this date
month the month of this date as a number, 1-indexed
day the day of the month, 1-indexed
weekday the day of the week, 0-indexed, starting on Sunday
hour the hour of this date
minute the minute of this date
second the second of this date

Methods

date() this time as an ISO-8601 date string.
dayname() the name of the weekday.
format(string specifiers) print this date as a string according to the given strftime specifiers.
monthname() this name of the month.
set(string iso) set the date value from an ISO-8601 string
time() this time as an ISO-8601 time string.

Constructor Documentation


Time()

Create a new date with the current time


Time(string iso)

Create a new date from an ISO-8601 string

Parameters


Time(integer year, integer month, integer day, integer hour, integer minute, integer second)

Create a new date

Parameters

Property Documentation


integer year

The year of this date


integer month

The month of this date as a number, 1-indexed


integer day

The day of the month, 1-indexed


integer weekday

The day of the week, 0-indexed, starting on Sunday


integer hour

The hour of this date


integer minute

The minute of this date


integer second

The second of this date

Method Documentation


string date()

This time as an ISO-8601 date string.

Returns


string dayname()

The name of the weekday.

Returns


string format(string specifiers)

Print this date as a string according to the given strftime specifiers.

Parameters

Returns


string monthname()

This name of the month.

Returns


void set(string iso)

Set the date value from an ISO-8601 string

Parameters


string time()

This time as an ISO-8601 time string.

Returns



Creative Commons Logo This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.