Dates¶
The date type in Kiwi is used to represent a date and a time.
There is no Date literal syntax in Kiwi, but the language provides methods to access and use the type.
Builtins¶
For documentation on date builtins, take a look at the date builtins.
Get Current Date and Time¶
Using the standard library call time::now() or special builtin __time_now__().
dt = time::now() # using the `time` package from the Kiwi Standard Library.
dt = __time_now__() # using the special builtin `__time_now__()`
strings to dates¶
Use the to_date() builtin to convert a string to a date.
dates to strings¶
Use the to_string() builtin to convert a date to a string. Optionally, you can specify a format.