format
  • 30 Oct 2020
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

format

  • Dark
    Light
  • PDF

Article summary

Description

Applies a text formatting expression to an object.


Input Parameters

NameTypeRequiredDescription
objectAnyYesObject to format
expressionTextYesText 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.


What's Next