public toString(format as String) as String:
Returns a string representation using a custom format and the default locale.
| Parameter | Description |
|---|---|
format | The format string for the output (supports strftime tokens). |
A formatted string representation of this DateTime object.
import klyn.time
dt = DateTime(year=2023, month=10, day=5)
print(dt.toString("%Y/%m/%d")) # 2023/10/05