public toString(format as String, locale as Locale) as String:
Returns a string representation of this DateTime object using a specific locale.
| Parameter | Description |
|---|---|
format | The format string for the output (supports strftime tokens). |
locale | The locale to use for names and formatting. |
A string representation of the DateTime object.
import klyn.time
import klyn.i18n
dt = DateTime("2023-10-05 14:30:45")
print(dt.toString("%A %d %B %Y", Locale.FRANCE)) # jeudi 05 octobre 2023