/
How to set 12-Hour AM/PM Clock

How to set 12-Hour AM/PM Clock

From version 6.0.5 onwards, a 12-hour clock in AM/PM format can be created using API 5.0.

This can be done using the POST command.

API for creating Tile with clock in AM/PM:

POST : http://{{ip_address}}:{{port}}/api/5.0/tiles/config/.json

Body Structure

The below body creates AM/PM clock in Upcase. "variant": "Digital AM/PM - Upcase",

For AM/PM without Upcase, please change "variant": "Digital AM/PM"

{ "data": { "label": "AM/PM Upcase Clock", "version": 1, "content_type": "Clock", "min_width": 32, "min_height": 32, "default_width": 300, "default_height": 200, "description": "Black and white digital clock - AM/PM", "objects": [ { "type": "Clock", "left": { "pixels": 0, "percentage": null }, "right": { "pixels": 0, "percentage": null }, "top": { "pixels": 0, "percentage": null }, "bottom": { "pixels": 0, "percentage": null }, "max_width": { "pixels": null, "percentage": 100 }, "max_height": { "pixels": null, "percentage": 100 }, "alignment": "Top Left", "index": 1, "variant": "Digital AM/PM - Upcase", "color": "#e0e0e0" } ] }, "metadata": { "config_version": 1 } }

Response

{ "data": { "uuid": "d3ad19e9-1d35-4d46-81ee-7862a3edbea1", "label": "AM/PM Upcase Clock", "version": 1, "created": "2023-01-09T10:49:49.186Z", "modified": "2023-01-09T10:49:49.186Z", "content_type": "Clock", "min_width": 32, "min_height": 32, "default_width": 300, "default_height": 200, "description": "Black and white digital clock - AM/PM", "objects": [ { "type": "Clock", "left": { "pixels": 0, "percentage": null }, "right": { "pixels": 0, "percentage": null }, "top": { "pixels": 0, "percentage": null }, "bottom": { "pixels": 0, "percentage": null }, "max_width": { "pixels": null, "percentage": 100 }, "max_height": { "pixels": null, "percentage": 100 }, "alignment": "Top Left", "index": 1, "variant": "Digital AM/PM - Upcase", "color": "#e0e0e0" } ] }, "metadata": { "config_version": 1673205811618252 } }

 

The clock created through the API can be seen on the MCS and MCM9000 GUI as below.

 

 

Note: This example shows clock created for type “Black and white digital clock - AM/PM”. The same can be done for other clocks as well just by editing the “variant“ field with siffix AM/PM or AM/PM - Upcase for Upcase.

For example, if you prefer an analog clock without upcase in AM/PM format the variant field should be specifed as "variant": "Analog - AM/PM". For a 24Hr clock it would be "variant": "Analog"

Related content

API 4.1
Read with this
v5.0_Tile Editor
v5.0_Tile Editor
More like this
API Ver 5.0 R1
API Ver 5.0 R1
Read with this
Time Zones
More like this
Time Zones Configuration
Time Zones Configuration
More like this
How to Create a Tile Structure using API 5.0
How to Create a Tile Structure using API 5.0
More like this