- Print
- DarkLight
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
Description
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.