--- title: "format" slug: "tools-format" updated: 2025-11-06T19:01:22Z published: 2025-11-06T19:01:22Z canonical: "docs.doc-know.com/tools-format" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.doc-know.com/llms.txt > Use this file to discover all available pages before exploring further. # format ### tools.format Applies a text formatting expression to an object. ### Input Parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | **object** | Any | Yes | Object to format | | **expression** | Text | Yes | Text formatting expression | ### Returns Type: **Text** Returns a new string, representing the formatted object. ### Examples ``` // parse the date component from the current date-time var date = tools.format(tools.now, "MM/dd/yyyy"); debug.log(date); ``` ``` // parse the time component from the current date-time var time = tools.format(tools.now, "hh:mm tt"); debug.log(time); ``` ### Remarks Some objects can be formatted using a text-based formatting expression. Use this function when you need to perform this formatting.