Sets or gets whether the time picker uses 12-hour or 24-hour format.


The useAmPmFormat only affects the display format. A time picker always uses the 24-hour format for its value.

The useAmPmFormat property can be:

  • true: Displays a 12-hour time along with AM/PM indication. For example, 04:00 PM.
  • false: Displays a 24-hour time. For example, 16:00.

You can also set an element's useAmPmFormat property in the Editor using the Settings panel.


booleanRead & Write

Was this helpful?

Get whether a time picker is using the AM/PM format

Code Example

Copy Code
1let amPm = $w("#myTimeInput").useAmPmFormat; // false
Set a time picker to use the AM/PM format

Code Example

Copy Code
1$w("#myTimeInput").useAmPmFormat = true;