The TimeText element has the following attributes:
Required attributes
The following attributes are required:
format
A format string representing the time format.
This list includes several different formats for showing the time 12:34:56 PM:
hh:mm:ss renders as "12:34:56".
h:mm renders as "12:34"
hh_10 renders as "1".
hh_1 renders as "2".
m renders as "34"
mm_10 renders as "3".
mm_1 renders as "4".
ss renders as "56"
ss_10 renders as "5".
ss_1 renders as "6".
x, y, width, height
A collection of integers that specify the element's size and position.
Optional attributes
The following attributes are optional:
hourFormat
Whether to use 12- or 24-hour notation to display the time. Defaults to
SYNC_TO_DEVICE, which applies the user's preference that's configured on the
device.
align:
How to align the text within the bounding box. Defaults to "START".
pivotX, pivotY
A two-dimensional pivot point about which the element rotates. Both values
are floating-point numbers that are scaled to fit in the range $ [0, 1] $.
angle
A number of degrees, clockwise, that the element should be rotated about its
pivot point.
alpha
Set the level of transparency that this element should have. A value of 0
indicates that the element should be completely transparent. A value of 255
indicates that the element should be completely opaque.
tintColor
Apply a tint color filter to the element. You must specify the color using
either the ARGB format (#ff000000 = opaque black) or the RGB format
(#000000 = black).
Inner elements
The TimeText element can contain the following inner elements:
Variant
Allows for changing attributes of this element when the Wear OS device is in
ambient mode. More information is available in the Variant reference.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-05-20 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-20 UTC."],[],[],null,["# TimeText\n\nWatch Face Format version Version 4 Version 3 Version 2 Version 1\n\n*** ** * ** ***\n\nA time text is a formatted string representing the current time.\n\nIntroduced in Wear OS 4.\n\nSyntax\n------\n\n```xml\n\u003cTimeText format=\"string\" hourFormat=\"12 | 24 | SYNC_TO_DEVICE\"\n align=\"START | CENTER | END\" x=\"integer\" y=\"integer\"\n width=\"integer\" height=\"integer\" pivotX=\"float\" pivotY=\"float\"\n angle=\"float-degrees\" alpha=\"integer\"\n tintColor=\"argb-color | rgb-color\" /\u003e\n```\n\nAttributes\n----------\n\nThe `TimeText` element has the following attributes:\n\n### Required attributes\n\nThe following attributes are required:\n\n`format`\n\n: A format string representing the time format.\n\n This list includes several different formats for showing the time 12:34:56 PM:\n\n - `hh:mm:ss` renders as \"12:34:56\".\n - `h:mm` renders as \"12:34\"\n - `hh_10` renders as \"1\".\n - `hh_1` renders as \"2\".\n - `m` renders as \"34\"\n - `mm_10` renders as \"3\".\n - `mm_1` renders as \"4\".\n - `ss` renders as \"56\"\n - `ss_10` renders as \"5\".\n - `ss_1` renders as \"6\".\n\n`x`, `y`, `width`, `height`\n\n: A collection of integers that specify the element's size and position.\n\n### Optional attributes\n\nThe following attributes are optional:\n\n`hourFormat`\n: Whether to use 12- or 24-hour notation to display the time. Defaults to\n `SYNC_TO_DEVICE`, which applies the user's preference that's configured on the\n device.\n\n`align`:\n: How to align the text within the bounding box. Defaults to \"START\".\n\n`pivotX`, `pivotY`\n: A two-dimensional pivot point about which the element rotates. Both values\n are floating-point numbers that are scaled to fit in the range $ \\[0, 1\\] $.\n\n`angle`\n: A number of degrees, clockwise, that the element should be rotated about its\n pivot point.\n\n`alpha`\n: Set the level of transparency that this element should have. A value of `0`\n indicates that the element should be completely transparent. A value of `255`\n indicates that the element should be completely opaque.\n\n`tintColor`\n: Apply a tint color filter to the element. You must specify the color using\n either the ARGB format (`#ff000000` = opaque black) or the RGB format\n (`#000000` = black).\n\nInner elements\n--------------\n\nThe `TimeText` element can contain the following inner elements:\n\n`Variant`\n: Allows for changing attributes of this element when the Wear OS device is in\n ambient mode. More information is available in the [`Variant`](/training/wearables/wff/common/variant/variant) reference.\n\n`BitmapFont`\n: A [BitmapFont](/training/wearables/wff/group/part/text/bitmap-font) to use for rendering the time.\n\n`Font`\n: A [Font](/training/wearables/wff/group/part/text/font) to use for rendering the time.\n\nRecommended for you\n-------------------\n\n- Note: link text is displayed when JavaScript is off\n- [DigitalClock](/training/wearables/wff/clock/digital-clock)\n- [AnalogClock](/training/wearables/wff/clock/analog-clock)\n- [Group](/training/wearables/wff/group/group)"]]