Skip to main content

SetTimeFormat

Sets time format for field.

Syntax

expression.SetTimeFormat(format);

expression - A variable that represents a ApiTextField class.

Parameters

NameRequired/OptionalData typeDefaultDescription
formatRequiredTimeFormatavailable time format

Returns

boolean

Example

Display times in a consistent format like hours and minutes in a PDF.

// How do I show time input in a specific format in a PDF?

// Configure time display patterns for a text field in a PDF.

let doc = Api.GetDocument();
let page = doc.GetPage(0);
let textField = Api.CreateTextField([10, 10, 160, 30]);
page.AddObject(textField);

textField.SetTimeFormat("12HR:MM:SS");
textField.SetValue("8:45:30");